From 75e8244fd7914d2ac0c3622d2277b84c4bfa7ffb Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 4 Jun 2022 20:00:01 -0400 Subject: comonad/cofree => comonad/free --- stdlib/source/test/lux/abstract.lux | 4 +- stdlib/source/test/lux/abstract/comonad/cofree.lux | 51 ---------------------- stdlib/source/test/lux/abstract/comonad/free.lux | 51 ++++++++++++++++++++++ stdlib/source/test/lux/macro/local.lux | 2 +- 4 files changed, 54 insertions(+), 54 deletions(-) delete mode 100644 stdlib/source/test/lux/abstract/comonad/cofree.lux create mode 100644 stdlib/source/test/lux/abstract/comonad/free.lux (limited to 'stdlib/source/test') diff --git a/stdlib/source/test/lux/abstract.lux b/stdlib/source/test/lux/abstract.lux index 974778af5..b044876aa 100644 --- a/stdlib/source/test/lux/abstract.lux +++ b/stdlib/source/test/lux/abstract.lux @@ -6,7 +6,7 @@ ["[1][0]" apply] ["[1][0]" codec] ["[1][0]" comonad (.only) - ["[1]/[0]" cofree]] + ["[1]/[0]" free]] ["[1][0]" enum] ["[1][0]" equivalence] ["[1][0]" hash] @@ -38,7 +38,7 @@ Test (all _.and /comonad.test - /comonad/cofree.test + /comonad/free.test )) (def: .public test diff --git a/stdlib/source/test/lux/abstract/comonad/cofree.lux b/stdlib/source/test/lux/abstract/comonad/cofree.lux deleted file mode 100644 index 2f2b7569b..000000000 --- a/stdlib/source/test/lux/abstract/comonad/cofree.lux +++ /dev/null @@ -1,51 +0,0 @@ -(.using - [library - [lux (.except) - ["_" test (.only Test)] - [abstract - [functor (.only Functor)] - [comonad (.only CoMonad)] - [\\specification - ["$[0]" functor (.only Injection Comparison)] - ["$[0]" comonad]]] - [control - ["//" continuation]] - [data - [collection - ["[0]" list] - ["[0]" stream (.only Stream) (.open: "[1]#[0]" comonad)]]] - [math - ["[0]" random]]]] - [\\library - ["[0]" /]]) - -(def: (injection value) - (Injection (/.CoFree Stream)) - [value (stream#each injection (stream.repeated value))]) - -(def: (interpret [head tail]) - (All (_ a) (-> (/.CoFree Stream a) (Stream a))) - (|> tail - (stream#each (at (/.comonad stream.functor) out)) - [head] - //.pending)) - -(def: comparison - (Comparison (/.CoFree Stream)) - (function (_ == left right) - (at (list.equivalence ==) = - (stream.first 100 (..interpret left)) - (stream.first 100 (..interpret right))))) - -(def: .public test - Test - (<| (_.covering /._) - (_.for [/.CoFree]) - (all _.and - (_.for [/.functor] - ($functor.spec ..injection ..comparison (is (Functor (/.CoFree Stream)) - (/.functor stream.functor)))) - (_.for [/.comonad] - ($comonad.spec ..injection ..comparison (is (CoMonad (/.CoFree Stream)) - (/.comonad stream.functor)))) - ))) diff --git a/stdlib/source/test/lux/abstract/comonad/free.lux b/stdlib/source/test/lux/abstract/comonad/free.lux new file mode 100644 index 000000000..9c84654c2 --- /dev/null +++ b/stdlib/source/test/lux/abstract/comonad/free.lux @@ -0,0 +1,51 @@ +(.using + [library + [lux (.except) + ["_" test (.only Test)] + [abstract + [functor (.only Functor)] + [comonad (.only CoMonad)] + [\\specification + ["$[0]" functor (.only Injection Comparison)] + ["$[0]" comonad]]] + [control + ["//" continuation]] + [data + [collection + ["[0]" list] + ["[0]" stream (.only Stream) (.open: "[1]#[0]" comonad)]]] + [math + ["[0]" random]]]] + [\\library + ["[0]" /]]) + +(def: (injection value) + (Injection (/.Free Stream)) + [value (stream#each injection (stream.repeated value))]) + +(def: (interpret [head tail]) + (All (_ a) (-> (/.Free Stream a) (Stream a))) + (|> tail + (stream#each (at (/.comonad stream.functor) out)) + [head] + //.pending)) + +(def: comparison + (Comparison (/.Free Stream)) + (function (_ == left right) + (at (list.equivalence ==) = + (stream.first 100 (..interpret left)) + (stream.first 100 (..interpret right))))) + +(def: .public test + Test + (<| (_.covering /._) + (_.for [/.Free]) + (all _.and + (_.for [/.functor] + ($functor.spec ..injection ..comparison (is (Functor (/.Free Stream)) + (/.functor stream.functor)))) + (_.for [/.comonad] + ($comonad.spec ..injection ..comparison (is (CoMonad (/.Free Stream)) + (/.comonad stream.functor)))) + ))) diff --git a/stdlib/source/test/lux/macro/local.lux b/stdlib/source/test/lux/macro/local.lux index 910ffe079..a38dc8be7 100644 --- a/stdlib/source/test/lux/macro/local.lux +++ b/stdlib/source/test/lux/macro/local.lux @@ -1,6 +1,6 @@ (.using [library - [lux (.except) + [lux (.except with) ["_" test (.only Test)] ["[0]" meta] [abstract -- cgit v1.2.3