diff options
author | Eduardo Julian | 2022-06-04 20:00:01 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-06-04 20:00:01 -0400 |
commit | 75e8244fd7914d2ac0c3622d2277b84c4bfa7ffb (patch) | |
tree | 317e26d0702e8c73669b9cef39979c0d2ed93b17 /stdlib/source/library | |
parent | f9e33ae96aec4741385a576719786092c9e68043 (diff) |
comonad/cofree => comonad/free
Diffstat (limited to 'stdlib/source/library')
16 files changed, 30 insertions, 21 deletions
diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index cdcb304a0..1c550ec22 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -4264,11 +4264,20 @@ _ (failure (..wrong_syntax_error (symbol ..refer))))) +(macro: .public (with tokens) + (case (..parsed (..andP ..anyP ..anyP) + tokens) + {.#Some [implementation expression]} + (meta#in (list (` (..let [(..open (~ (text$ (alias_stand_in 0)))) (~ implementation)] + (~ expression))))) + + {.#None} + (failure (..wrong_syntax_error (symbol ..with))))) + (macro: .public (at tokens) (case tokens - (pattern (list struct [_ {#Symbol member}])) - (meta#in (list (` (..let [(..open (~ (text$ (alias_stand_in 0)))) (~ struct)] - (~ (symbol$ member)))))) + (pattern (list implementation [_ {#Symbol member}])) + (meta#in (list (` (..with (~ implementation) (~ (symbol$ member)))))) (pattern (partial_list struct member args)) (meta#in (list (` ((..at (~ struct) (~ member)) (~+ args))))) diff --git a/stdlib/source/library/lux/abstract/comonad/cofree.lux b/stdlib/source/library/lux/abstract/comonad/free.lux index 2b4ec2b4e..cba43d06d 100644 --- a/stdlib/source/library/lux/abstract/comonad/cofree.lux +++ b/stdlib/source/library/lux/abstract/comonad/free.lux @@ -5,17 +5,17 @@ [// [functor (.only Functor)]]]) -(type: .public (CoFree F a) - [a (F (CoFree F a))]) +(type: .public (Free F a) + [a (F (Free F a))]) (implementation: .public (functor dsl) - (All (_ F) (-> (Functor F) (Functor (CoFree F)))) + (All (_ F) (-> (Functor F) (Functor (Free F)))) (def: (each f [head tail]) [(f head) (at dsl each (each f) tail)])) (implementation: .public (comonad dsl) - (All (_ F) (-> (Functor F) (CoMonad (CoFree F)))) + (All (_ F) (-> (Functor F) (CoMonad (Free F)))) (def: functor (..functor dsl)) diff --git a/stdlib/source/library/lux/control/exception.lux b/stdlib/source/library/lux/control/exception.lux index 7aed1de63..48276683c 100644 --- a/stdlib/source/library/lux/control/exception.lux +++ b/stdlib/source/library/lux/control/exception.lux @@ -1,6 +1,6 @@ (.using [library - [lux (.except except) + [lux (.except except with) ["[0]" macro] ["[0]" meta] [abstract diff --git a/stdlib/source/library/lux/control/maybe.lux b/stdlib/source/library/lux/control/maybe.lux index 72b1f30aa..dafd471d1 100644 --- a/stdlib/source/library/lux/control/maybe.lux +++ b/stdlib/source/library/lux/control/maybe.lux @@ -1,6 +1,6 @@ (.using [library - [lux (.except list) + [lux (.except list with) [abstract [monoid (.only Monoid)] [equivalence (.only Equivalence)] diff --git a/stdlib/source/library/lux/control/reader.lux b/stdlib/source/library/lux/control/reader.lux index 651ce0eb8..cd2d5b053 100644 --- a/stdlib/source/library/lux/control/reader.lux +++ b/stdlib/source/library/lux/control/reader.lux @@ -1,6 +1,6 @@ (.using [library - [lux (.except local) + [lux (.except local with) ["@" target] [abstract [apply (.only Apply)] diff --git a/stdlib/source/library/lux/control/state.lux b/stdlib/source/library/lux/control/state.lux index b5a87549d..798e42b16 100644 --- a/stdlib/source/library/lux/control/state.lux +++ b/stdlib/source/library/lux/control/state.lux @@ -1,6 +1,6 @@ (.using [library - [lux (.except local) + [lux (.except local with) [abstract [functor (.only Functor)] [apply (.only Apply)] diff --git a/stdlib/source/library/lux/control/try.lux b/stdlib/source/library/lux/control/try.lux index dd43a0ea1..897ae0adf 100644 --- a/stdlib/source/library/lux/control/try.lux +++ b/stdlib/source/library/lux/control/try.lux @@ -1,6 +1,6 @@ (.using [library - [lux (.except) + [lux (.except with) ["@" target] [abstract [apply (.only Apply)] diff --git a/stdlib/source/library/lux/control/writer.lux b/stdlib/source/library/lux/control/writer.lux index 40540eb04..e08e494d1 100644 --- a/stdlib/source/library/lux/control/writer.lux +++ b/stdlib/source/library/lux/control/writer.lux @@ -1,6 +1,6 @@ (.using [library - [lux (.except) + [lux (.except with) ["@" target] [abstract [monoid (.only Monoid)] diff --git a/stdlib/source/library/lux/data/collection/list.lux b/stdlib/source/library/lux/data/collection/list.lux index 903d5ae3f..ba1902276 100644 --- a/stdlib/source/library/lux/data/collection/list.lux +++ b/stdlib/source/library/lux/data/collection/list.lux @@ -1,6 +1,6 @@ (.using [library - [lux (.except revised all only) + [lux (.except revised all only with) ["@" target] [abstract [monoid (.only Monoid)] diff --git a/stdlib/source/library/lux/meta/location.lux b/stdlib/source/library/lux/meta/location.lux index 640dcee6a..c66147ba8 100644 --- a/stdlib/source/library/lux/meta/location.lux +++ b/stdlib/source/library/lux/meta/location.lux @@ -1,6 +1,6 @@ (.using [library - [lux (.except) + [lux (.except with) [abstract [equivalence (.only Equivalence)]]]]) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/module.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/module.lux index 9aabc7d10..1a897fb6c 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/module.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/module.lux @@ -1,6 +1,6 @@ (.using [library - [lux (.except Label) + [lux (.except Label with) [abstract ["[0]" monad (.only do)]] [control diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/scope.lux b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/scope.lux index bf221d35b..2fa60d94f 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/analysis/scope.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/analysis/scope.lux @@ -1,6 +1,6 @@ (.using [library - [lux (.except local) + [lux (.except local with) [abstract [monad (.only do)]] [control diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux index 493776886..e2fe1fd05 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension.lux @@ -1,6 +1,6 @@ (.using [library - [lux (.except) + [lux (.except with) [abstract [equivalence (.only Equivalence)] [hash (.only Hash)] diff --git a/stdlib/source/library/lux/tool/compiler/phase.lux b/stdlib/source/library/lux/tool/compiler/phase.lux index e3cf241ba..480ad7380 100644 --- a/stdlib/source/library/lux/tool/compiler/phase.lux +++ b/stdlib/source/library/lux/tool/compiler/phase.lux @@ -1,6 +1,6 @@ (.using [library - [lux (.except except) + [lux (.except except with) [abstract [functor (.only Functor)] [monad (.only Monad do)]] diff --git a/stdlib/source/library/lux/type/check.lux b/stdlib/source/library/lux/type/check.lux index 497e0e6cc..4e9a81e48 100644 --- a/stdlib/source/library/lux/type/check.lux +++ b/stdlib/source/library/lux/type/check.lux @@ -1,6 +1,6 @@ (.using [library - [lux (.except try except) + [lux (.except try except with) ["@" target] [abstract [functor (.only Functor)] diff --git a/stdlib/source/library/lux/type/implicit.lux b/stdlib/source/library/lux/type/implicit.lux index fbe04737a..95e9a53dc 100644 --- a/stdlib/source/library/lux/type/implicit.lux +++ b/stdlib/source/library/lux/type/implicit.lux @@ -1,6 +1,6 @@ (.using [library - [lux (.except) + [lux (.except with) [abstract ["[0]" monad (.only do)] ["[0]" equivalence]] |