diff options
author | Eduardo Julian | 2017-01-25 20:30:44 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-01-25 20:30:44 -0400 |
commit | 216a12cd02337c83c889a667063e0c06f2944e65 (patch) | |
tree | 5394a1bbf8df4d28de5625fd1803bf2ccbbe1a04 | |
parent | 0a9547eed8546519e883bc40a38104842de2988c (diff) |
- Moved the lux/data/struct/* modules to lux/data/coll/*.
- Did the same for the lux/codata/struct/* modules.
- Moved lux/codata/io to lux/io.
- Moved lux/control/effect to lux/effect.
- Renamed "sample" functions to "this" functions.
- Renamed "at" functions to "nth" functions.
Diffstat (limited to '')
101 files changed, 331 insertions, 324 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux index bb53b987e..f86d8cdae 100644 --- a/stdlib/source/lux.lux +++ b/stdlib/source/lux.lux @@ -3234,7 +3234,7 @@ (list module) (list& (substring2 0 idx module) (split-module (substring1 (i.+ 1 idx) module)))))) -(def: (at idx xs) +(def: (nth idx xs) (All [a] (-> Int (List a) (Maybe a))) (case xs @@ -3244,7 +3244,7 @@ (#Cons x xs') (if (i.= idx 0) (#Some x) - (at (i.- 1 idx) xs') + (nth (i.- 1 idx) xs') ))) (def: (beta-reduce env type) @@ -3279,7 +3279,7 @@ (#LambdaT (beta-reduce env ?input) (beta-reduce env ?output)) (#BoundT idx) - (case (at (_lux_proc ["nat" "to-int"] [idx]) env) + (case (nth (_lux_proc ["nat" "to-int"] [idx]) env) (#Some bound) bound @@ -3870,7 +3870,7 @@ num-ups (length ups)] (if (i.= num-ups 0) (return module) - (case (at num-ups (split-module-contexts module-name)) + (case (nth num-ups (split-module-contexts module-name)) #None (fail (Text/append "Can't clean module: " module)) @@ -4491,7 +4491,7 @@ lux (lux (control (monad #as M #refer #all)) (data (text #open (\"Text/\" Monoid<Text>)) - (struct (list #open (\"List/\" Monad<List>))) + (coll (list #open (\"List/\" Monad<List>))) maybe (ident #open (\"Ident/\" Codec<Text,Ident>))) meta @@ -4502,7 +4502,7 @@ lux (lux (control [\"M\" monad #*]) (data [text \"Text/\" Monoid<Text>] - (struct [list \"List/\" Monad<List>]) + (coll [list \"List/\" Monad<List>]) maybe [ident \"Ident/\" Codec<Text,Ident>]) meta @@ -4735,7 +4735,7 @@ [#;ExQ]) (#;BoundT idx) - (default type (list;at idx env)) + (default type (list;nth idx env)) _ type diff --git a/stdlib/source/lux/cli.lux b/stdlib/source/lux/cli.lux index a8604180b..410cd42d5 100644 --- a/stdlib/source/lux/cli.lux +++ b/stdlib/source/lux/cli.lux @@ -8,11 +8,11 @@ (lux (control functor applicative monad) - (data (struct (list #as list #open ("List/" Monoid<List> Monad<List>))) + (data (coll (list #as list #open ("List/" Monoid<List> Monad<List>))) (text #as text #open ("Text/" Monoid<Text>)) error (sum #as sum)) - (codata [io]) + [io] [compiler #+ with-gensyms Functor<Lux> Monad<Lux>] (macro [ast] ["s" syntax #+ syntax: Syntax]))) diff --git a/stdlib/source/lux/codata/struct/stream.lux b/stdlib/source/lux/codata/coll/stream.lux index 5691b0c69..eeee1ccc2 100644 --- a/stdlib/source/lux/codata/struct/stream.lux +++ b/stdlib/source/lux/codata/coll/stream.lux @@ -10,7 +10,7 @@ comonad) [compiler #+ with-gensyms] (macro ["s" syntax #+ syntax: Syntax]) - (data (struct [list "List/" Monad<List>]) + (data (coll [list "List/" Monad<List>]) bool) (codata [cont #+ @lazy Cont]))) @@ -59,11 +59,11 @@ [head a h] [tail (Stream a) t]) -(def: #export (at idx s) +(def: #export (nth idx s) (All [a] (-> Nat (Stream a) a)) (let [[h t] (cont;run s)] (if (n.> +0 idx) - (at (n.dec idx) t) + (nth (n.dec idx) t) h))) (do-template [<taker> <dropper> <splitter> <pred-type> <pred-test> <pred-step>] diff --git a/stdlib/source/lux/codata/cont.lux b/stdlib/source/lux/codata/cont.lux index 7f1b787e1..f04b6a0ba 100644 --- a/stdlib/source/lux/codata/cont.lux +++ b/stdlib/source/lux/codata/cont.lux @@ -9,7 +9,7 @@ (control functor applicative monad) - (data (struct list))) + (data (coll list))) (.. function)) ## [Types] @@ -42,11 +42,17 @@ (k a)) k))) +(def: #export (continue f thunk) + {#;doc "Forces a continuation thunk to be evaluated."} + (All [i o] + (-> (-> i o) (Cont i o) o)) + (thunk f)) + (def: #export (run thunk) {#;doc "Forces a continuation thunk to be evaluated."} (All [a] (-> (Cont a) a)) - (thunk id)) + (continue id thunk)) ## [Structs] (struct: #export _ (Functor Cont) diff --git a/stdlib/source/lux/compiler.lux b/stdlib/source/lux/compiler.lux index 367217524..9f667ebce 100644 --- a/stdlib/source/lux/compiler.lux +++ b/stdlib/source/lux/compiler.lux @@ -9,7 +9,7 @@ (control functor applicative monad) - (data (struct [list #* "List/" Monoid<List> Monad<List>]) + (data (coll [list #* "List/" Monoid<List> Monad<List>]) [number] [text "Text/" Monoid<Text> Eq<Text>] [product] diff --git a/stdlib/source/lux/concurrency/actor.lux b/stdlib/source/lux/concurrency/actor.lux index e55386d9d..73529e987 100644 --- a/stdlib/source/lux/concurrency/actor.lux +++ b/stdlib/source/lux/concurrency/actor.lux @@ -6,11 +6,11 @@ (;module: {#;doc "The actor model of concurrency."} lux (lux (control monad) - (codata [io #- run] - function) + [io #- run] + (codata function) (data [error #- fail] text/format - (struct [list "List/" Monoid<List> Monad<List>]) + (coll [list "List/" Monoid<List> Monad<List>]) [product] [number "Nat/" Codec<Text,Nat>]) [compiler #+ with-gensyms] @@ -154,7 +154,7 @@ (def: method^ (Syntax Method) (s;form (do s;Monad<Syntax> - [_ (s;sample! (' method:)) + [_ (s;this! (' method:)) vars (s;default (list) (s;tuple (s;some s;local-symbol))) [name args] (s;form ($_ s;seq s;local-symbol @@ -171,7 +171,7 @@ (def: stop^ (Syntax AST) (s;form (do s;Monad<Syntax> - [_ (s;sample! (' stop:))] + [_ (s;this! (' stop:))] s;any))) (def: actor-decl^ diff --git a/stdlib/source/lux/concurrency/atom.lux b/stdlib/source/lux/concurrency/atom.lux index ae8c7fa21..c879db02d 100644 --- a/stdlib/source/lux/concurrency/atom.lux +++ b/stdlib/source/lux/concurrency/atom.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io #- run]) + (lux [io #- run] host)) (jvm-import (java.util.concurrent.atomic.AtomicReference V) diff --git a/stdlib/source/lux/concurrency/frp.lux b/stdlib/source/lux/concurrency/frp.lux index 45b9e1839..14563e534 100644 --- a/stdlib/source/lux/concurrency/frp.lux +++ b/stdlib/source/lux/concurrency/frp.lux @@ -9,9 +9,9 @@ applicative monad eq) - (codata [io #- run] - function) - (data (struct [list]) + [io #- run] + (codata function) + (data (coll [list]) text/format) [compiler] (macro ["s" syntax #+ syntax: Syntax])) diff --git a/stdlib/source/lux/concurrency/promise.lux b/stdlib/source/lux/concurrency/promise.lux index 1d33ee4ee..60cffe2fe 100644 --- a/stdlib/source/lux/concurrency/promise.lux +++ b/stdlib/source/lux/concurrency/promise.lux @@ -5,12 +5,12 @@ (;module: lux - (lux (data (struct [list #* "" Functor<List>]) + (lux (data (coll [list #* "" Functor<List>]) number text/format error) - (codata [io #- run] - function) + [io #- run] + (codata function) (control functor applicative monad) diff --git a/stdlib/source/lux/concurrency/stm.lux b/stdlib/source/lux/concurrency/stm.lux index 06912a25a..b088bd607 100644 --- a/stdlib/source/lux/concurrency/stm.lux +++ b/stdlib/source/lux/concurrency/stm.lux @@ -8,10 +8,10 @@ (lux (control functor applicative monad) - (codata [io #- run]) - (data (struct [list #* "List/" Functor<List>] - [dict #+ Dict] - ["Q" queue]) + [io #- run] + (data (coll [list #* "List/" Functor<List>] + [dict #+ Dict] + ["Q" queue]) [product] [text] maybe diff --git a/stdlib/source/lux/control/comonad.lux b/stdlib/source/lux/control/comonad.lux index 046511190..00d807ef1 100644 --- a/stdlib/source/lux/control/comonad.lux +++ b/stdlib/source/lux/control/comonad.lux @@ -6,7 +6,7 @@ (;module: lux ["F" ../functor] - [lux/data/struct/list #* "" Fold<List>]) + [lux/data/coll/list #* "" Fold<List>]) ## [Signatures] (sig: #export (CoMonad w) diff --git a/stdlib/source/lux/data/char.lux b/stdlib/source/lux/data/char.lux index 9c9baaf20..49c247f93 100644 --- a/stdlib/source/lux/data/char.lux +++ b/stdlib/source/lux/data/char.lux @@ -65,13 +65,13 @@ (or (n.= +4 size) (n.= +5 size))) (if (n.= +4 size) - (case (text;at +2 y) + (case (text;nth +2 y) #;None (#;Left (Text/append "Wrong syntax for Char: " y)) (#;Some char) (#;Right char)) - (case [(text;at +2 y) (text;at +3 y)] + (case [(text;nth +2 y) (text;nth +3 y)] [(#;Some #"\\") (#;Some char)] (case char #"t" (#;Right #"\t") diff --git a/stdlib/source/lux/data/struct/array.lux b/stdlib/source/lux/data/coll/array.lux index fa52df9f1..f95754262 100644 --- a/stdlib/source/lux/data/struct/array.lux +++ b/stdlib/source/lux/data/coll/array.lux @@ -12,7 +12,7 @@ eq fold) (data error - (struct [list "List/" Fold<List>]) + (coll [list "List/" Fold<List>]) [product]) )) diff --git a/stdlib/source/lux/data/struct/dict.lux b/stdlib/source/lux/data/coll/dict.lux index 3b153d229..fe77d0bea 100644 --- a/stdlib/source/lux/data/struct/dict.lux +++ b/stdlib/source/lux/data/coll/dict.lux @@ -8,8 +8,8 @@ (lux (control hash eq) (data maybe - (struct [list "List/" Fold<List> Functor<List> Monoid<List>] - [array #+ Array "Array/" Functor<Array> Fold<Array>]) + (coll [list "List/" Fold<List> Functor<List> Monoid<List>] + [array #+ Array "Array/" Functor<Array> Fold<Array>]) [bit] [product] text/format diff --git a/stdlib/source/lux/data/struct/list.lux b/stdlib/source/lux/data/coll/list.lux index 3228e1d78..9b0328b16 100644 --- a/stdlib/source/lux/data/struct/list.lux +++ b/stdlib/source/lux/data/coll/list.lux @@ -215,7 +215,7 @@ [every? true and] [any? false or]) -(def: #export (at i xs) +(def: #export (nth i xs) {#;doc "Fetches the element at the specified index."} (All [a] (-> Nat (List a) (Maybe a))) @@ -226,7 +226,7 @@ (#;Cons [x xs']) (if (n.= +0 i) (#;Some x) - (at (n.dec i) xs')))) + (nth (n.dec i) xs')))) ## [Structures] (struct: #export (Eq<List> Eq<a>) diff --git a/stdlib/source/lux/data/struct/queue.lux b/stdlib/source/lux/data/coll/queue.lux index 1c7fcdc3e..4dcac337c 100644 --- a/stdlib/source/lux/data/struct/queue.lux +++ b/stdlib/source/lux/data/coll/queue.lux @@ -6,7 +6,7 @@ (;module: lux (lux (control eq) - (data (struct [list "List/" Monoid<List>])))) + (data (coll [list "List/" Monoid<List>])))) ## [Types] (type: #export (Queue a) diff --git a/stdlib/source/lux/data/struct/set.lux b/stdlib/source/lux/data/coll/set.lux index 711ae4553..952e8f055 100644 --- a/stdlib/source/lux/data/struct/set.lux +++ b/stdlib/source/lux/data/coll/set.lux @@ -10,8 +10,8 @@ monad eq [hash #*]) - (data (struct [dict] - [list "List/" Fold<List> Functor<List>])) + (data (coll [dict] + [list "List/" Fold<List> Functor<List>])) (codata function))) ## [Types] diff --git a/stdlib/source/lux/data/struct/stack.lux b/stdlib/source/lux/data/coll/stack.lux index e62a74590..05364b832 100644 --- a/stdlib/source/lux/data/struct/stack.lux +++ b/stdlib/source/lux/data/coll/stack.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (data (struct [list])))) + (lux (data (coll [list])))) ## [Types] (type: #export (Stack a) diff --git a/stdlib/source/lux/data/struct/tree/rose.lux b/stdlib/source/lux/data/coll/tree/rose.lux index 8620e46a7..4c4f873d5 100644 --- a/stdlib/source/lux/data/struct/tree/rose.lux +++ b/stdlib/source/lux/data/coll/tree/rose.lux @@ -7,7 +7,7 @@ lux (lux (control monad eq) - (data (struct [list "" Monad<List>])) + (data (coll [list "" Monad<List>])) [compiler] (macro [ast] ["s" syntax #+ syntax: Syntax]))) diff --git a/stdlib/source/lux/data/struct/tree/zipper.lux b/stdlib/source/lux/data/coll/tree/zipper.lux index 74dbd024f..c154ed19c 100644 --- a/stdlib/source/lux/data/struct/tree/zipper.lux +++ b/stdlib/source/lux/data/coll/tree/zipper.lux @@ -5,9 +5,9 @@ (;module: lux - (lux (data (struct [list "" Monad<List> Fold<List> "List/" Monoid<List>] - (tree [rose #+ Tree]) - [stack #+ Stack])) + (lux (data (coll [list "" Monad<List> Fold<List> "List/" Monoid<List>] + (tree [rose #+ Tree]) + [stack #+ Stack])) [compiler] (macro [ast] ["s" syntax #+ syntax: Syntax]))) diff --git a/stdlib/source/lux/data/struct/vector.lux b/stdlib/source/lux/data/coll/vector.lux index 9a22efb93..1dbceb97e 100644 --- a/stdlib/source/lux/data/struct/vector.lux +++ b/stdlib/source/lux/data/coll/vector.lux @@ -12,8 +12,8 @@ monoid fold) (data maybe - (struct [list "List/" Fold<List> Functor<List> Monoid<List>] - [array #+ Array "Array/" Functor<Array> Fold<Array>]) + (coll [list "List/" Fold<List> Functor<List> Monoid<List>] + [array #+ Array "Array/" Functor<Array> Fold<Array>]) [bit] [number "Int/" Number<Int>] [product]) @@ -255,7 +255,7 @@ (error! "Incorrect vector structure.")))) #;None))) -(def: #export (at idx vec) +(def: #export (nth idx vec) (All [a] (-> Nat (Vector a) (Maybe a))) (do Monad<Maybe> [base (base-for idx vec)] @@ -276,7 +276,7 @@ (def: #export (update idx f vec) (All [a] (-> Nat (-> a a) (Vector a) (Vector a))) - (case (at idx vec) + (case (nth idx vec) (#;Some val) (put idx (f val) vec) diff --git a/stdlib/source/lux/data/format/json.lux b/stdlib/source/lux/data/format/json.lux index 66ad6c093..0c61b958b 100644 --- a/stdlib/source/lux/data/format/json.lux +++ b/stdlib/source/lux/data/format/json.lux @@ -21,9 +21,9 @@ [error #- fail] [sum] [product] - (struct [list "" Fold<List> "List/" Monad<List>] - [vector #+ Vector vector "Vector/" Monad<Vector>] - [dict #+ Dict])) + (coll [list "" Fold<List> "List/" Monad<List>] + [vector #+ Vector vector "Vector/" Monad<Vector>] + [dict #+ Dict])) (codata [function]) [compiler #+ Monad<Lux> with-gensyms] (macro [syntax #+ syntax:] @@ -544,13 +544,13 @@ _ (#;Left (format "JSON value is not an object: " (show-json json)))))) -(def: #export (at idx parser) +(def: #export (nth idx parser) {#;doc "Parses an element inside a JSON array."} (All [a] (-> Nat (Parser a) (Parser a))) (lambda [json] (case json (#Array values) - (case (vector;at idx values) + (case (vector;nth idx values) (#;Some value) (case (parser value) (#;Right output) @@ -689,8 +689,8 @@ (and prev (default false (do Monad<Maybe> - [x' (vector;at idx xs) - y' (vector;at idx ys)] + [x' (vector;nth idx xs) + y' (vector;nth idx ys)] (wrap (= x' y')))))) true (list;indices (vector;size xs)))) @@ -734,7 +734,7 @@ parsers (|> parts (list;zip2 (list;indices array-size)) (List/map (lambda [[idx parser]] - (` (at (~ (ast;nat idx)) (~ parser))))))] + (` (nth (~ (ast;nat idx)) (~ parser))))))] (wrap (list (` ($_ seq (~@ parsers)))))) (#ObjectShape kvs) @@ -757,7 +757,7 @@ parsers (|> parts (list;zip2 (list;indices array-size)) (List/map (lambda [[idx parser]] - (` (at (~ (ast;nat idx)) (~ parser))))))] + (` (nth (~ (ast;nat idx)) (~ parser))))))] (wrap (list (` (ensure (array-size! (~ (ast;nat array-size))) ($_ seq (~@ parsers))))))) @@ -998,8 +998,8 @@ [#let [tag (ast;tag name)] decoder (Codec<JSON,?>//decode new-*env* :case:)] (wrap (list (` (do Monad<Parser> - [(~ g!_) (;;at +0 (;;text! (~ (ast;text (product;right name))))) - (~ g!_) (;;at +1 (~ decoder))] + [(~ g!_) (;;nth +0 (;;text! (~ (ast;text (product;right name))))) + (~ g!_) (;;nth +1 (~ decoder))] ((~ (' wrap)) ((~ tag) (~ g!_))))))))) members) #let [:x:+ (case g!vars diff --git a/stdlib/source/lux/data/text.lux b/stdlib/source/lux/data/text.lux index 85d5d9dd5..adc0454b2 100644 --- a/stdlib/source/lux/data/text.lux +++ b/stdlib/source/lux/data/text.lux @@ -11,7 +11,7 @@ monad codec hash) - (data (struct [list]) + (data (coll [list]) maybe))) ## [Functions] @@ -19,7 +19,7 @@ (-> Text Nat) (int-to-nat (_lux_proc ["jvm" "i2l"] [(_lux_proc ["jvm" "invokevirtual:java.lang.String:length:"] [x])]))) -(def: #export (at idx x) +(def: #export (nth idx x) (-> Nat Text (Maybe Char)) (if (n.< (size x) idx) (#;Some (_lux_proc ["jvm" "invokevirtual:java.lang.String:charAt:int"] [x (_lux_proc ["jvm" "l2i"] [(nat-to-int idx)])])) diff --git a/stdlib/source/lux/data/text/format.lux b/stdlib/source/lux/data/text/format.lux index 2ae5c62ca..732de0db4 100644 --- a/stdlib/source/lux/data/text/format.lux +++ b/stdlib/source/lux/data/text/format.lux @@ -11,7 +11,7 @@ [number] [text] [ident] - (struct [list "" Monad<List>])) + (coll [list "" Monad<List>])) [type] [compiler] (macro [ast] diff --git a/stdlib/source/lux/control/effect.lux b/stdlib/source/lux/effect.lux index 2b81ad543..de3038927 100644 --- a/stdlib/source/lux/control/effect.lux +++ b/stdlib/source/lux/effect.lux @@ -8,8 +8,8 @@ (lux (control ["F" functor] applicative monad) - (codata [io #- run]) - (data (struct [list "List/" Monad<List> Monoid<List>]) + [io #- run] + (data (coll [list "List/" Monad<List> Monoid<List>]) [number "Nat/" Codec<Text,Nat>] text/format error @@ -217,7 +217,7 @@ (def: translation^ (Syntax Translation) (s;form (do s;Monad<Syntax> - [_ (s;sample! (' =>))] + [_ (s;this! (' =>))] (s;seq s;symbol (s;tuple (s;seq s;any s;any)))))) diff --git a/stdlib/source/lux/host.lux b/stdlib/source/lux/host.lux index ededaa0a4..58d163c2e 100644 --- a/stdlib/source/lux/host.lux +++ b/stdlib/source/lux/host.lux @@ -7,10 +7,10 @@ lux (lux (control monad [enum]) - (codata function - [io #+ IO Monad<IO> io]) - (data (struct [list #* "" Functor<List> Fold<List> "List/" Monad<List> Monoid<List>] - [array #+ Array]) + [io #+ IO Monad<IO> io] + (codata function) + (data (coll [list #* "" Functor<List> Fold<List> "List/" Monad<List> Monoid<List>] + [array #+ Array]) number maybe [product] @@ -561,14 +561,14 @@ (-> Text Text (Syntax AST)) (do s;Monad<Syntax> [#let [dotted-name (format "." field-name)] - _ (s;sample! (ast;symbol ["" dotted-name]))] + _ (s;this! (ast;symbol ["" dotted-name]))] (wrap (`' (_lux_proc ["jvm" (~ (ast;text (format "getstatic" ":" class-name ":" field-name)))] []))))) (def: (make-get-var-parser class-name field-name) (-> Text Text (Syntax AST)) (do s;Monad<Syntax> [#let [dotted-name (format "." field-name)] - _ (s;sample! (ast;symbol ["" dotted-name]))] + _ (s;this! (ast;symbol ["" dotted-name]))] (wrap (`' (_lux_proc ["jvm" (~ (ast;text (format "getfield" ":" class-name ":" field-name)))] [_jvm_this]))))) (def: (make-put-var-parser class-name field-name) @@ -576,7 +576,7 @@ (do s;Monad<Syntax> [#let [dotted-name (format "." field-name)] [_ _ value] (: (Syntax [Unit Unit AST]) - (s;form ($_ s;seq (s;sample! (' :=)) (s;sample! (ast;symbol ["" dotted-name])) s;any)))] + (s;form ($_ s;seq (s;this! (' :=)) (s;this! (ast;symbol ["" dotted-name])) s;any)))] (wrap (`' (_lux_proc ["jvm" (~ (ast;text (format "putfield" ":" class-name ":" field-name)))] [_jvm_this (~ value)]))))) (def: (pre-walk-replace f input) @@ -621,7 +621,7 @@ (-> (List TypeParam) Text (List ArgDecl) (Syntax AST)) (do s;Monad<Syntax> [[_ args] (: (Syntax [Unit (List AST)]) - (s;form ($_ s;seq (s;sample! (' .new!)) (s;tuple (s;exactly (list;size arg-decls) s;any))))) + (s;form ($_ s;seq (s;this! (' .new!)) (s;tuple (s;exactly (list;size arg-decls) s;any))))) #let [arg-decls' (: (List Text) (map (. (simple-class$ params) product;right) arg-decls))]] (wrap (` (;_lux_proc ["jvm" (~ (ast;text (format "new" ":" class-name ":" (text;join-with "," arg-decls'))))] [(~@ args)]))))) @@ -631,7 +631,7 @@ (do s;Monad<Syntax> [#let [dotted-name (format "." method-name "!")] [_ args] (: (Syntax [Unit (List AST)]) - (s;form ($_ s;seq (s;sample! (ast;symbol ["" dotted-name])) (s;tuple (s;exactly (list;size arg-decls) s;any))))) + (s;form ($_ s;seq (s;this! (ast;symbol ["" dotted-name])) (s;tuple (s;exactly (list;size arg-decls) s;any))))) #let [arg-decls' (: (List Text) (map (. (simple-class$ params) product;right) arg-decls))]] (wrap (`' (;_lux_proc ["jvm" (~ (ast;text (format "invokestatic" ":" class-name ":" method-name ":" (text;join-with "," arg-decls'))))] [(~@ args)]))))) @@ -642,7 +642,7 @@ (do s;Monad<Syntax> [#let [dotted-name (format "." method-name "!")] [_ args] (: (Syntax [Unit (List AST)]) - (s;form ($_ s;seq (s;sample! (ast;symbol ["" dotted-name])) (s;tuple (s;exactly (list;size arg-decls) s;any))))) + (s;form ($_ s;seq (s;this! (ast;symbol ["" dotted-name])) (s;tuple (s;exactly (list;size arg-decls) s;any))))) #let [arg-decls' (: (List Text) (map (. (simple-class$ params) product;right) arg-decls))]] (wrap (`' (;_lux_proc ["jvm" (~ (ast;text (format <jvm-op> ":" class-name ":" method-name ":" (text;join-with "," arg-decls'))))] [(~' _jvm_this) (~@ args)])))))] @@ -680,32 +680,32 @@ (Syntax PrivacyModifier) (let [(^open) s;Monad<Syntax>] ($_ s;alt - (s;sample! (' #public)) - (s;sample! (' #private)) - (s;sample! (' #protected)) + (s;this! (' #public)) + (s;this! (' #private)) + (s;this! (' #protected)) (wrap [])))) (def: inheritance-modifier^ (Syntax InheritanceModifier) (let [(^open) s;Monad<Syntax>] ($_ s;alt - (s;sample! (' #final)) - (s;sample! (' #abstract)) + (s;this! (' #final)) + (s;this! (' #abstract)) (wrap [])))) (def: bound-kind^ (Syntax BoundKind) - (s;alt (s;sample! (' <)) - (s;sample! (' >)))) + (s;alt (s;this! (' <)) + (s;this! (' >)))) (def: (generic-type^ imports type-vars) (-> ClassImports (List TypeParam) (Syntax GenericType)) ($_ s;either (do s;Monad<Syntax> - [_ (s;sample! (' ?))] + [_ (s;this! (' ?))] (wrap (#GenericWildcard #;None))) (s;tuple (do s;Monad<Syntax> - [_ (s;sample! (' ?)) + [_ (s;this! (' ?)) bound-kind bound-kind^ bound (generic-type^ imports type-vars)] (wrap (#GenericWildcard (#;Some [bound-kind bound]))))) @@ -731,7 +731,7 @@ ## else (wrap (#GenericClass name (list)))))) (s;form (do s;Monad<Syntax> - [name (s;sample! (' Array)) + [name (s;this! (' Array)) component (generic-type^ imports type-vars)] (case component (^template [<class> <name>] @@ -763,7 +763,7 @@ (wrap [param-name (list)])) (s;tuple (do s;Monad<Syntax> [param-name s;local-symbol - _ (s;sample! (' <)) + _ (s;this! (' <)) bounds (s;many (generic-type^ imports (list)))] (wrap [param-name bounds]))))) @@ -807,7 +807,7 @@ (def: (annotations^' imports) (-> ClassImports (Syntax (List Annotation))) (do s;Monad<Syntax> - [_ (s;sample! (' #ann))] + [_ (s;this! (' #ann))] (s;tuple (s;some (annotation^ imports))))) (def: (annotations^ imports) @@ -819,7 +819,7 @@ (def: (throws-decl'^ imports type-vars) (-> ClassImports (List TypeParam) (Syntax (List GenericType))) (do s;Monad<Syntax> - [_ (s;sample! (' #throws))] + [_ (s;this! (' #throws))] (s;tuple (s;some (generic-type^ imports type-vars))))) (def: (throws-decl^ imports type-vars) @@ -845,14 +845,14 @@ (def: state-modifier^ (Syntax StateModifier) ($_ s;alt - (s;sample! (' #volatile)) - (s;sample! (' #final)) + (s;this! (' #volatile)) + (s;this! (' #final)) (:: s;Monad<Syntax> wrap []))) (def: (field-decl^ imports type-vars) (-> ClassImports (List TypeParam) (Syntax [MemberDecl FieldDecl])) (s;either (s;form (do s;Monad<Syntax> - [_ (s;sample! (' #const)) + [_ (s;this! (' #const)) name s;local-symbol anns (annotations^ imports) type (generic-type^ imports type-vars) @@ -887,10 +887,10 @@ (-> ClassImports (List TypeParam) (Syntax [MemberDecl MethodDef])) (s;form (do s;Monad<Syntax> [pm privacy-modifier^ - strict-fp? (s;sample? (' #strict)) + strict-fp? (s;this? (' #strict)) method-vars (s;default (list) (type-params^ imports)) #let [total-vars (List/append class-vars method-vars)] - [_ arg-decls] (s;form (s;seq (s;sample! (' new)) + [_ arg-decls] (s;form (s;seq (s;this! (' new)) (arg-decls^ imports total-vars))) constructor-args (constructor-args^ imports total-vars) exs (throws-decl^ imports total-vars) @@ -905,8 +905,8 @@ (-> ClassImports (List TypeParam) (Syntax [MemberDecl MethodDef])) (s;form (do s;Monad<Syntax> [pm privacy-modifier^ - strict-fp? (s;sample? (' #strict)) - final? (s;sample? (' #final)) + strict-fp? (s;this? (' #strict)) + final? (s;this? (' #final)) method-vars (s;default (list) (type-params^ imports)) #let [total-vars (List/append class-vars method-vars)] [name arg-decls] (s;form (s;seq s;local-symbol @@ -923,7 +923,7 @@ (def: (overriden-method-def^ imports) (-> ClassImports (Syntax [MemberDecl MethodDef])) (s;form (do s;Monad<Syntax> - [strict-fp? (s;sample? (' #strict)) + [strict-fp? (s;this? (' #strict)) owner-class (class-decl^ imports) method-vars (s;default (list) (type-params^ imports)) #let [total-vars (List/append (product;right owner-class) method-vars)] @@ -942,8 +942,8 @@ (-> ClassImports (Syntax [MemberDecl MethodDef])) (s;form (do s;Monad<Syntax> [pm privacy-modifier^ - strict-fp? (s;sample? (' #strict)) - _ (s;sample! (' #static)) + strict-fp? (s;this? (' #strict)) + _ (s;this! (' #static)) method-vars (s;default (list) (type-params^ imports)) #let [total-vars method-vars] [name arg-decls] (s;form (s;seq s;local-symbol @@ -961,7 +961,7 @@ (-> ClassImports (Syntax [MemberDecl MethodDef])) (s;form (do s;Monad<Syntax> [pm privacy-modifier^ - _ (s;sample! (' #abstract)) + _ (s;this! (' #abstract)) method-vars (s;default (list) (type-params^ imports)) #let [total-vars method-vars] [name arg-decls] (s;form (s;seq s;local-symbol @@ -978,7 +978,7 @@ (-> ClassImports (Syntax [MemberDecl MethodDef])) (s;form (do s;Monad<Syntax> [pm privacy-modifier^ - _ (s;sample! (' #native)) + _ (s;this! (' #native)) method-vars (s;default (list) (type-params^ imports)) #let [total-vars method-vars] [name arg-decls] (s;form (s;seq s;local-symbol @@ -1008,42 +1008,42 @@ (def: class-kind^ (Syntax ClassKind) (s;either (do s;Monad<Syntax> - [_ (s;sample! (' #class))] + [_ (s;this! (' #class))] (wrap #Class)) (do s;Monad<Syntax> - [_ (s;sample! (' #interface))] + [_ (s;this! (' #interface))] (wrap #Interface)) )) (def: import-member-alias^ (Syntax (Maybe Text)) (s;opt (do s;Monad<Syntax> - [_ (s;sample! (' #as))] + [_ (s;this! (' #as))] s;local-symbol))) (def: (import-member-args^ imports type-vars) (-> ClassImports (List TypeParam) (Syntax (List [Bool GenericType]))) - (s;tuple (s;some (s;seq (s;sample? (' #?)) (generic-type^ imports type-vars))))) + (s;tuple (s;some (s;seq (s;this? (' #?)) (generic-type^ imports type-vars))))) (def: import-member-return-flags^ (Syntax [Bool Bool Bool]) - ($_ s;seq (s;sample? (' #io)) (s;sample? (' #try)) (s;sample? (' #?)))) + ($_ s;seq (s;this? (' #io)) (s;this? (' #try)) (s;this? (' #?)))) (def: primitive-mode^ (Syntax Primitive-Mode) - (s;alt (s;sample! (' #manual)) - (s;sample! (' #auto)))) + (s;alt (s;this! (' #manual)) + (s;this! (' #auto)))) (def: (import-member-decl^ imports owner-vars) (-> ClassImports (List TypeParam) (Syntax ImportMemberDecl)) ($_ s;either (s;form (do s;Monad<Syntax> - [_ (s;sample! (' #enum)) + [_ (s;this! (' #enum)) enum-members (s;some s;local-symbol)] (wrap (#EnumDecl enum-members)))) (s;form (do s;Monad<Syntax> [tvars (s;default (list) (type-params^ imports)) - _ (s;sample! (' new)) + _ (s;this! (' new)) ?alias import-member-alias^ #let [total-vars (List/append owner-vars tvars)] ?prim-mode (s;opt primitive-mode^) @@ -1061,7 +1061,7 @@ )) (s;form (do s;Monad<Syntax> [kind (: (Syntax ImportMethodKind) - (s;alt (s;sample! (' #static)) + (s;alt (s;this! (' #static)) (wrap []))) tvars (s;default (list) (type-params^ imports)) name s;local-symbol @@ -1083,12 +1083,12 @@ #import-method-return return }])))) (s;form (do s;Monad<Syntax> - [static? (s;sample? (' #static)) + [static? (s;this? (' #static)) name s;local-symbol ?prim-mode (s;opt primitive-mode^) gtype (generic-type^ imports owner-vars) - maybe? (s;sample? (' #?)) - setter? (s;sample? (' #!))] + maybe? (s;this? (' #?)) + setter? (s;this? (' #!))] (wrap (#FieldAccessDecl {#import-field-mode (default #AutoPrM ?prim-mode) #import-field-name name #import-field-static? static? @@ -1251,7 +1251,7 @@ (#OverridenMethod strict-fp? class-decl type-vars arg-decls return-type body exs) (let [super-replacer (parser->replacer (s;form (do s;Monad<Syntax> - [_ (s;sample! (' .super!)) + [_ (s;this! (' .super!)) args (s;tuple (s;exactly (list;size arg-decls) s;any)) #let [arg-decls' (: (List Text) (map (. (simple-class$ (list)) product;right) arg-decls))]] @@ -1944,7 +1944,7 @@ (compiler;fail (format "Unknown class: " class-name)))) (syntax: #export (jvm-import [#let [imports (class-imports *compiler*)]] - [long-name? (s;sample? (' #long))] + [long-name? (s;this? (' #long))] [class-decl (class-decl^ imports)] [#let [full-class-name (product;left class-decl) imports (add-import [(short-class-name full-class-name) full-class-name] diff --git a/stdlib/source/lux/codata/io.lux b/stdlib/source/lux/io.lux index 60ea73834..e395e7c32 100644 --- a/stdlib/source/lux/codata/io.lux +++ b/stdlib/source/lux/io.lux @@ -8,7 +8,7 @@ (lux (control functor applicative monad) - (data (struct list)))) + (data (coll list)))) ## [Types] (type: #export (IO a) diff --git a/stdlib/source/lux/lexer.lux b/stdlib/source/lux/lexer.lux index ca8f7f5cf..03e5f5cbd 100644 --- a/stdlib/source/lux/lexer.lux +++ b/stdlib/source/lux/lexer.lux @@ -15,7 +15,7 @@ [char "Char/" Ord<Char>] maybe ["E" error #- fail] - (struct [list "" Functor<List>])))) + (coll [list "" Functor<List>])))) ## [Types] (type: #export (Lexer a) @@ -86,7 +86,7 @@ {#;doc "Just returns the next character without applying any logic."} (Lexer Char) (lambda [input] - (case [(text;at +0 input) (text;split +1 input)] + (case [(text;nth +0 input) (text;split +1 input)] [(#;Some output) (#;Some [_ input'])] (#E;Success [input' output]) @@ -276,7 +276,7 @@ {#;doc "Lex the next character (without consuming it from the input)."} (Lexer Char) (lambda [input] - (case (text;at +0 input) + (case (text;nth +0 input) (#;Some output) (#E;Success [input output]) @@ -288,7 +288,7 @@ {#;doc "Lex a character if it matches the given sample."} (-> Char (Lexer Char)) (lambda [input] - (case [(text;at +0 input) (text;split +1 input)] + (case [(text;nth +0 input) (text;split +1 input)] [(#;Some char') (#;Some [_ input'])] (if (Char/= test char') (#E;Success [input' test]) @@ -352,7 +352,7 @@ (case (text;split +1 input) (#;Some [init input']) (if (text;contains? init options) - (case (text;at +0 init) + (case (text;nth +0 init) (#;Some output) (#E;Success [input' output]) @@ -370,7 +370,7 @@ (case (text;split +1 input) (#;Some [init input']) (if (;not (text;contains? init options)) - (case (text;at +0 init) + (case (text;nth +0 init) (#;Some output) (#E;Success [input' output]) @@ -388,7 +388,7 @@ (case (: (Maybe [Text Char]) (do Monad<Maybe> [[init input'] (text;split +1 input) - output (text;at +0 init)] + output (text;nth +0 init)] (wrap [input' output]))) (#;Some [input' output]) (if (p output) diff --git a/stdlib/source/lux/lexer/regex.lux b/stdlib/source/lux/lexer/regex.lux index 5684a4465..503364ce0 100644 --- a/stdlib/source/lux/lexer/regex.lux +++ b/stdlib/source/lux/lexer/regex.lux @@ -11,7 +11,7 @@ text/format [number "Int/" Codec<Text,Int>] [product] - (struct [list "" Fold<List> "List/" Monad<List>])) + (coll [list "" Fold<List> "List/" Monad<List>])) [compiler #- run] (macro [ast] [syntax #+ syntax:]) diff --git a/stdlib/source/lux/macro.lux b/stdlib/source/lux/macro.lux index b06deedb7..54d41b28f 100644 --- a/stdlib/source/lux/macro.lux +++ b/stdlib/source/lux/macro.lux @@ -6,14 +6,14 @@ (;module: lux (lux (control monad) - (data (struct [list "List/" Monad<List>]) + (data (coll [list "List/" Monad<List>]) text/format) [compiler] (macro ["s" syntax #+ syntax: Syntax]))) (def: omit^ (Syntax Bool) - (s;sample? (' #omit))) + (s;this? (' #omit))) (do-template [<macro> <func>] [(syntax: #export (<macro> [? omit^] token) diff --git a/stdlib/source/lux/macro/ast.lux b/stdlib/source/lux/macro/ast.lux index 821264c09..d284a8043 100644 --- a/stdlib/source/lux/macro/ast.lux +++ b/stdlib/source/lux/macro/ast.lux @@ -11,7 +11,7 @@ [char] [text #+ Eq<Text> "Text/" Monoid<Text>] ident - (struct [list #* "" Functor<List> Fold<List>]) + (coll [list #* "" Functor<List> Fold<List>]) ))) ## [Types] diff --git a/stdlib/source/lux/macro/poly.lux b/stdlib/source/lux/macro/poly.lux index d194a540b..5420e0328 100644 --- a/stdlib/source/lux/macro/poly.lux +++ b/stdlib/source/lux/macro/poly.lux @@ -9,8 +9,8 @@ [eq]) (data [text] text/format - (struct [list "List/" Fold<List> Monad<List>] - [dict #+ Dict]) + (coll [list "List/" Fold<List> Monad<List>] + [dict #+ Dict]) [number] [product] [bool] diff --git a/stdlib/source/lux/macro/poly/eq.lux b/stdlib/source/lux/macro/poly/eq.lux index bdce71d50..a9d7c0fae 100644 --- a/stdlib/source/lux/macro/poly/eq.lux +++ b/stdlib/source/lux/macro/poly/eq.lux @@ -9,8 +9,8 @@ [eq]) (data [text] text/format - (struct [list "List/" Monad<List>] - [dict #+ Dict]) + (coll [list "List/" Monad<List>] + [dict #+ Dict]) [number] [product] [bool] diff --git a/stdlib/source/lux/macro/poly/functor.lux b/stdlib/source/lux/macro/poly/functor.lux index e659bb41d..ec06193bf 100644 --- a/stdlib/source/lux/macro/poly/functor.lux +++ b/stdlib/source/lux/macro/poly/functor.lux @@ -9,8 +9,8 @@ [functor]) (data [text] text/format - (struct [list "List/" Monad<List>] - [dict #+ Dict]) + (coll [list "List/" Monad<List>] + [dict #+ Dict]) [number] [product] [bool] diff --git a/stdlib/source/lux/macro/poly/text-encoder.lux b/stdlib/source/lux/macro/poly/text-encoder.lux index c538844a7..c197f8e0c 100644 --- a/stdlib/source/lux/macro/poly/text-encoder.lux +++ b/stdlib/source/lux/macro/poly/text-encoder.lux @@ -9,8 +9,8 @@ [codec]) (data [text] text/format - (struct [list "List/" Monad<List>] - [dict #+ Dict]) + (coll [list "List/" Monad<List>] + [dict #+ Dict]) [number] [product] [bool] diff --git a/stdlib/source/lux/macro/syntax.lux b/stdlib/source/lux/macro/syntax.lux index ba24b607b..2713de9c1 100644 --- a/stdlib/source/lux/macro/syntax.lux +++ b/stdlib/source/lux/macro/syntax.lux @@ -15,7 +15,7 @@ [number] [text "Text/" Monoid<Text>] [ident] - (struct [list #* "" Functor<List> Fold<List> "List/" Monoid<List>]) + (coll [list #* "" Functor<List> Fold<List> "List/" Monoid<List>]) [product] [error #- fail])) (.. [ast "AST/" Eq<AST>])) @@ -113,7 +113,7 @@ [ tag Ident #;TagS ident;Eq<Ident> "tag"] ) -(def: #export (sample? ast) +(def: #export (this? ast) {#;doc "Asks if the given AST is the next input."} (-> AST (Syntax Bool)) (lambda [tokens] @@ -128,7 +128,7 @@ _ (#;Right [tokens false])))) -(def: #export (sample! ast) +(def: #export (this! ast) {#;doc "Ensures the given AST is the next input."} (-> AST (Syntax Unit)) (lambda [tokens] diff --git a/stdlib/source/lux/macro/syntax/common.lux b/stdlib/source/lux/macro/syntax/common.lux index 96203b4c2..3ebb716c6 100644 --- a/stdlib/source/lux/macro/syntax/common.lux +++ b/stdlib/source/lux/macro/syntax/common.lux @@ -8,7 +8,7 @@ The goal is to be able to reuse common syntax in macro definitions across libraries."} lux (lux (control monad) - (data (struct [list]) + (data (coll [list]) text/format [ident "Ident/" Eq<Ident>] [product]) @@ -27,8 +27,8 @@ #export #hidden)} (Syntax (Maybe Export-Level)) - (s;opt (s;alt (s;sample! (' #export)) - (s;sample! (' #hidden))))) + (s;opt (s;alt (s;this! (' #export)) + (s;this! (' #hidden))))) (def: #export (gen-export-level ?el) (-> (Maybe Export-Level) (List AST)) @@ -70,7 +70,7 @@ (def: check^ (Syntax [(Maybe AST) AST]) (s;either (s;form (do s;Monad<Syntax> - [_ (s;sample! (' lux;_lux_:)) + [_ (s;this! (' lux;_lux_:)) type s;any value s;any] (wrap [(#;Some type) value]))) @@ -83,9 +83,9 @@ (def: (_def-anns^ _) (-> Top (Syntax (List [Ident AST]))) - (s;alt (s;sample! (' #lux;Nil)) + (s;alt (s;this! (' #lux;Nil)) (s;form (do s;Monad<Syntax> - [_ (s;sample! (' #lux;Cons)) + [_ (s;this! (' #lux;Cons)) [head tail] (s;seq (s;tuple (s;seq _def-anns-tag^ s;any)) (_def-anns^ []))] (wrap [head tail]))) @@ -94,10 +94,10 @@ (def: (flat-list^ _) (-> Top (Syntax (List AST))) (s;either (do s;Monad<Syntax> - [_ (s;sample! (' #lux;Nil))] + [_ (s;this! (' #lux;Nil))] (wrap (list))) (s;form (do s;Monad<Syntax> - [_ (s;sample! (' #lux;Cons)) + [_ (s;this! (' #lux;Cons)) [head tail] (s;tuple (s;seq s;any s;any)) tail (s;local (list tail) (flat-list^ []))] (wrap (#;Cons head tail)))))) @@ -105,13 +105,13 @@ (def: list-meta^ (Syntax (List AST)) (s;form (do s;Monad<Syntax> - [_ (s;sample! (' #lux;ListA))] + [_ (s;this! (' #lux;ListA))] (flat-list^ [])))) (def: text-meta^ (Syntax Text) (s;form (do s;Monad<Syntax> - [_ (s;sample! (' #lux;TextA))] + [_ (s;this! (' #lux;TextA))] s;text))) (def: (find-def-args meta-data) @@ -138,7 +138,7 @@ (compiler;macro-expand-all def-raw))] (s;local me-def-raw (s;form (do @ - [_ (s;sample! (' lux;_lux_def)) + [_ (s;this! (' lux;_lux_def)) def-name s;local-symbol [?def-type def-value] check^ def-anns s;any diff --git a/stdlib/source/lux/math.lux b/stdlib/source/lux/math.lux index d5a03b421..1fdde77e6 100644 --- a/stdlib/source/lux/math.lux +++ b/stdlib/source/lux/math.lux @@ -6,7 +6,7 @@ (;module: {#;doc "Common mathematical constants and functions."} lux (lux (control monad) - (data (struct [list "" Fold<List>]) + (data (coll [list "" Fold<List>]) [number "Int/" Number<Int>] [product] text/format) @@ -122,7 +122,7 @@ (s/map ast;tag s;tag)) (s;form (s;many s;any)) (s;tuple (s;either (do s;Monad<Syntax> - [_ (s;sample! (' #and)) + [_ (s;this! (' #and)) init-subject (infix^ []) init-op s;any init-param (infix^ []) diff --git a/stdlib/source/lux/math/complex.lux b/stdlib/source/lux/math/complex.lux index 9666abdab..ef91715ad 100644 --- a/stdlib/source/lux/math/complex.lux +++ b/stdlib/source/lux/math/complex.lux @@ -16,7 +16,7 @@ text/format error maybe - (struct [list "List/" Monad<List>])) + (coll [list "List/" Monad<List>])) [compiler] (macro [ast] ["s" syntax #+ syntax: Syntax]))) diff --git a/stdlib/source/lux/math/simple.lux b/stdlib/source/lux/math/simple.lux index f8b059794..45ba0a4a4 100644 --- a/stdlib/source/lux/math/simple.lux +++ b/stdlib/source/lux/math/simple.lux @@ -8,7 +8,7 @@ (lux (control monad) (data text/format [product] - (struct [list])) + (coll [list])) [compiler] (macro [ast] ["s" syntax #+ syntax: Syntax]) diff --git a/stdlib/source/lux/pipe.lux b/stdlib/source/lux/pipe.lux index 12337e3ef..2008971c4 100644 --- a/stdlib/source/lux/pipe.lux +++ b/stdlib/source/lux/pipe.lux @@ -6,7 +6,7 @@ (;module: {#;doc "Composable extensions to the piping macro |> that enhance it with various abilities."} lux (lux (control monad) - (data (struct [list #+ Monad<List> "" Fold<List> "List/" Monad<List>]) + (data (coll [list #+ Monad<List> "" Fold<List> "List/" Monad<List>]) maybe) [compiler #+ with-gensyms Monad<Lux>] (macro ["s" syntax #+ syntax: Syntax] diff --git a/stdlib/source/lux/random.lux b/stdlib/source/lux/random.lux index 195255643..468b6a34b 100644 --- a/stdlib/source/lux/random.lux +++ b/stdlib/source/lux/random.lux @@ -15,13 +15,13 @@ text/format [product] [number] - (struct [list "List/" Fold<List>] - ["A" array] - ["D" dict] - ["Q" queue] - ["S" set] - ["ST" stack] - ["V" vector])) + (coll [list "List/" Fold<List>] + ["A" array] + ["D" dict] + ["Q" queue] + ["S" set] + ["ST" stack] + ["V" vector])) (math ["r" ratio] ["c" complex]))) @@ -288,7 +288,7 @@ (def: (swap from to vec) (All [a] (-> Nat Nat (V;Vector a) (V;Vector a))) (V;put to (default (undefined) - (V;at from vec)) + (V;nth from vec)) vec)) (def: #export (shuffle seed vector) diff --git a/stdlib/source/lux/test.lux b/stdlib/source/lux/test.lux index 9524a2168..3b582815e 100644 --- a/stdlib/source/lux/test.lux +++ b/stdlib/source/lux/test.lux @@ -12,12 +12,12 @@ applicative monad) (concurrency [promise #+ Promise Monad<Promise>]) - (data (struct [list "List/" Monad<List> Fold<List>]) + (data (coll [list "List/" Monad<List> Fold<List>]) [product] [text] text/format [error #- fail "Error/" Monad<Error>]) - (codata [io #- run]) + [io #- run] ["R" random] [host #- try])) @@ -136,10 +136,10 @@ (def: config^ (Syntax Test-Config) (s;alt (do s;Monad<Syntax> - [_ (s;sample! (' #seed))] + [_ (s;this! (' #seed))] s;nat) (do s;Monad<Syntax> - [_ (s;sample! (' #times))] + [_ (s;this! (' #times))] s;nat))) (def: property-test^ diff --git a/stdlib/source/lux/type.lux b/stdlib/source/lux/type.lux index cda44670b..7610773b1 100644 --- a/stdlib/source/lux/type.lux +++ b/stdlib/source/lux/type.lux @@ -11,7 +11,7 @@ [ident "Ident/" Eq<Ident>] [number "Nat/" Codec<Text,Nat>] maybe - (struct [list #+ "List/" Monad<List> Monoid<List> Fold<List>])) + (coll [list #+ "List/" Monad<List> Monoid<List> Fold<List>])) (macro [ast]) )) @@ -41,7 +41,7 @@ (#;BoundT idx) (default (error! (Text/append "Unknown type var: " (Nat/encode idx))) - (list;at idx env)) + (list;nth idx env)) _ type diff --git a/stdlib/source/lux/type/auto.lux b/stdlib/source/lux/type/auto.lux index 2266827c9..28ba34090 100644 --- a/stdlib/source/lux/type/auto.lux +++ b/stdlib/source/lux/type/auto.lux @@ -10,8 +10,8 @@ (data [text "Text/" Eq<Text>] text/format [number] - (struct [list "List/" Monad<List> Fold<List>] - [dict]) + (coll [list "List/" Monad<List> Fold<List>] + [dict]) [bool] [product]) [compiler #+ Monad<Lux>] diff --git a/stdlib/source/lux/type/check.lux b/stdlib/source/lux/type/check.lux index 25cf19834..78461f7d7 100644 --- a/stdlib/source/lux/type/check.lux +++ b/stdlib/source/lux/type/check.lux @@ -15,8 +15,8 @@ [number] maybe [product] - (struct [list] - [dict]) + (coll [list] + [dict]) [error #- fail]) [type "Type/" Eq<Type>] )) diff --git a/stdlib/test/test/lux.lux b/stdlib/test/test/lux.lux index cd394ac76..947676665 100644 --- a/stdlib/test/test/lux.lux +++ b/stdlib/test/test/lux.lux @@ -7,7 +7,7 @@ lux lux/test (lux (control monad) - (codata [io]) + [io] [math] ["R" random] (data [text "T/" Eq<Text>] diff --git a/stdlib/test/test/lux/cli.lux b/stdlib/test/test/lux/cli.lux index 2aab87ae4..35b342000 100644 --- a/stdlib/test/test/lux/cli.lux +++ b/stdlib/test/test/lux/cli.lux @@ -5,14 +5,14 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data text/format [text "Text/" Eq<Text>] [number] [product] [sum] - (struct [list])) + (coll [list])) (codata function) ["&" cli] ["R" random] diff --git a/stdlib/test/test/lux/codata/struct/stream.lux b/stdlib/test/test/lux/codata/coll/stream.lux index 41132b2ee..9dc10c07f 100644 --- a/stdlib/test/test/lux/codata/struct/stream.lux +++ b/stdlib/test/test/lux/codata/coll/stream.lux @@ -5,16 +5,16 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad comonad) (data [text "Text/" Monoid<Text>] text/format - (struct [list]) + (coll [list]) [number "Nat/" Codec<Text,Nat>]) (codata function [cont] - (struct ["&" stream])) + (coll ["&" stream])) ["R" random] pipe) lux/test) @@ -53,7 +53,7 @@ )) (assert "Can repeat any element and infinite number of times." - (n.= elem (&;at offset (&;repeat elem)))) + (n.= elem (&;nth offset (&;repeat elem)))) (assert "Can obtain the head & tail of a stream." (and (n.= offset (&;head sample1)) @@ -62,13 +62,13 @@ (assert "Can filter streams." (and (n.= (n.* +2 offset) - (&;at offset - (&;filter n.even? sample0))) + (&;nth offset + (&;filter n.even? sample0))) (let [[evens odds] (&;partition n.even? (&;iterate n.inc +0))] (and (n.= (n.* +2 offset) - (&;at offset evens)) + (&;nth offset evens)) (n.= (n.inc (n.* +2 offset)) - (&;at offset odds)))))) + (&;nth offset odds)))))) (assert "Functor goes over 'all' elements in a stream." (let [(^open "&/") &;Functor<Stream> @@ -99,8 +99,8 @@ (assert "Can cycle over the same elements as an infinite stream." (|> (&;cycle cycle-seed) (default (undefined)) - (&;at cycle-sample-idx) + (&;nth cycle-sample-idx) (n.= (default (undefined) - (list;at (n.% size cycle-sample-idx) - cycle-seed))))) + (list;nth (n.% size cycle-sample-idx) + cycle-seed))))) )) diff --git a/stdlib/test/test/lux/codata/cont.lux b/stdlib/test/test/lux/codata/cont.lux index 39fdd6f42..b0e906248 100644 --- a/stdlib/test/test/lux/codata/cont.lux +++ b/stdlib/test/test/lux/codata/cont.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data [text "Text/" Monoid<Text>] text/format diff --git a/stdlib/test/test/lux/codata/env.lux b/stdlib/test/test/lux/codata/env.lux index 4f5a37de9..2acad142f 100644 --- a/stdlib/test/test/lux/codata/env.lux +++ b/stdlib/test/test/lux/codata/env.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data [text "Text/" Monoid<Text>] text/format diff --git a/stdlib/test/test/lux/codata/state.lux b/stdlib/test/test/lux/codata/state.lux index 79a458cc0..d73ebaa58 100644 --- a/stdlib/test/test/lux/codata/state.lux +++ b/stdlib/test/test/lux/codata/state.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data [text "Text/" Monoid<Text>] text/format diff --git a/stdlib/test/test/lux/concurrency/actor.lux b/stdlib/test/test/lux/concurrency/actor.lux index 7136ab30d..5ae191512 100644 --- a/stdlib/test/test/lux/concurrency/actor.lux +++ b/stdlib/test/test/lux/concurrency/actor.lux @@ -5,14 +5,14 @@ (;module: lux - (lux (control monad) + (lux [io #- run] + (control monad) (data [number] text/format [error #- fail]) (concurrency [promise #+ Promise Monad<Promise> "Promise/" Monad<Promise>] ["&" actor #+ actor:]) - (codata function - [io #- run])) + (codata function)) lux/test) (actor: Adder diff --git a/stdlib/test/test/lux/concurrency/atom.lux b/stdlib/test/test/lux/concurrency/atom.lux index 312bc0369..a2ef82562 100644 --- a/stdlib/test/test/lux/concurrency/atom.lux +++ b/stdlib/test/test/lux/concurrency/atom.lux @@ -5,10 +5,10 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data [number] - (struct [list "" Functor<List>]) + (coll [list "" Functor<List>]) text/format) (concurrency ["&" atom]) ["R" random] diff --git a/stdlib/test/test/lux/concurrency/frp.lux b/stdlib/test/test/lux/concurrency/frp.lux index 6bec2ea37..2d0b75f95 100644 --- a/stdlib/test/test/lux/concurrency/frp.lux +++ b/stdlib/test/test/lux/concurrency/frp.lux @@ -5,14 +5,14 @@ (;module: lux - (lux (control monad) + (lux [io #- run] + (control monad) (data [number] text/format [error #- fail]) (concurrency [promise #+ Promise Monad<Promise> "Promise/" Monad<Promise>] ["&" frp]) - (codata function - [io #- run])) + (codata function)) lux/test) (def: (List->Chan values) diff --git a/stdlib/test/test/lux/concurrency/promise.lux b/stdlib/test/test/lux/concurrency/promise.lux index 53accdfcc..c217fccf9 100644 --- a/stdlib/test/test/lux/concurrency/promise.lux +++ b/stdlib/test/test/lux/concurrency/promise.lux @@ -5,13 +5,13 @@ (;module: lux - (lux (control monad) + (lux [io #- run] + (control monad) (data [number] text/format [error #- fail]) (concurrency ["&" promise]) - (codata function - [io #- run]) + (codata function) ["R" random] pipe) lux/test) diff --git a/stdlib/test/test/lux/concurrency/stm.lux b/stdlib/test/test/lux/concurrency/stm.lux index 5b385c685..763804018 100644 --- a/stdlib/test/test/lux/concurrency/stm.lux +++ b/stdlib/test/test/lux/concurrency/stm.lux @@ -5,10 +5,10 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data [number] - (struct [list "" Functor<List> "List/" Fold<List>]) + (coll [list "" Functor<List> "List/" Fold<List>]) text/format) (concurrency ["&" stm] [promise]) diff --git a/stdlib/test/test/lux/data/bit.lux b/stdlib/test/test/lux/data/bit.lux index 0b66b30f5..0da5cfd45 100644 --- a/stdlib/test/test/lux/data/bit.lux +++ b/stdlib/test/test/lux/data/bit.lux @@ -5,8 +5,8 @@ (;module: lux - (lux (control [monad]) - (codata [io]) + (lux [io] + (control [monad]) (data ["&" bit] number) ["R" random]) diff --git a/stdlib/test/test/lux/data/bool.lux b/stdlib/test/test/lux/data/bool.lux index 4c196546c..669232f47 100644 --- a/stdlib/test/test/lux/data/bool.lux +++ b/stdlib/test/test/lux/data/bool.lux @@ -6,7 +6,7 @@ (;module: lux (lux (control [monad]) - (codata [io]) + [io] (data bool) ["R" random]) lux/test) diff --git a/stdlib/test/test/lux/data/char.lux b/stdlib/test/test/lux/data/char.lux index 6482dd219..460e98b24 100644 --- a/stdlib/test/test/lux/data/char.lux +++ b/stdlib/test/test/lux/data/char.lux @@ -6,7 +6,7 @@ (;module: lux (lux (control [monad]) - (codata [io]) + [io] (data char [text] text/format) @@ -35,7 +35,7 @@ (#;Left _) false)) (|> value as-text - (text;at +0) (default (undefined)) + (text;nth +0) (default (undefined)) (:: Eq<Char> = value)))) (assert "Characters have an ordering relationship." diff --git a/stdlib/test/test/lux/data/struct/array.lux b/stdlib/test/test/lux/data/coll/array.lux index ae7ff4bbc..236c2f915 100644 --- a/stdlib/test/test/lux/data/struct/array.lux +++ b/stdlib/test/test/lux/data/coll/array.lux @@ -6,9 +6,9 @@ (;module: lux (lux (control [monad]) - (codata [io]) - (data (struct ["&" array] - [list]) + [io] + (data (coll ["&" array] + [list]) [number]) ["R" random] pipe) diff --git a/stdlib/test/test/lux/data/struct/dict.lux b/stdlib/test/test/lux/data/coll/dict.lux index b467e232a..38b8e83b4 100644 --- a/stdlib/test/test/lux/data/struct/dict.lux +++ b/stdlib/test/test/lux/data/coll/dict.lux @@ -5,15 +5,15 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad [eq]) (data [text "Text/" Monoid<Text>] text/format [number] [char] - (struct ["&" dict] - [list "List/" Fold<List> Functor<List>])) + (coll ["&" dict] + [list "List/" Fold<List> Functor<List>])) (codata function) ["R" random] pipe) @@ -131,7 +131,7 @@ (&;contains? non-key rebound) (not (&;contains? first-key rebound)) (n.= (default (undefined) - (&;get first-key dict)) - (default (undefined) - (&;get non-key rebound))))))) + (&;get first-key dict)) + (default (undefined) + (&;get non-key rebound))))))) )) diff --git a/stdlib/test/test/lux/data/struct/list.lux b/stdlib/test/test/lux/data/coll/list.lux index b40615036..9df350b0b 100644 --- a/stdlib/test/test/lux/data/struct/list.lux +++ b/stdlib/test/test/lux/data/coll/list.lux @@ -5,9 +5,9 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) - (data (struct ["&" list]) + (data (coll ["&" list]) [text "Text/" Monoid<Text>] [number] [bool] @@ -62,7 +62,7 @@ (assert "Any element of the list can be considered it's member." (let [elem (default (undefined) - (&;at idx sample))] + (&;nth idx sample))] (&;member? number;Eq<Nat> sample elem))) )) diff --git a/stdlib/test/test/lux/data/struct/queue.lux b/stdlib/test/test/lux/data/coll/queue.lux index d92fecf10..e65c4eb74 100644 --- a/stdlib/test/test/lux/data/struct/queue.lux +++ b/stdlib/test/test/lux/data/coll/queue.lux @@ -5,9 +5,9 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) - (data (struct ["&" queue]) + (data (coll ["&" queue]) [number]) ["R" random] pipe) diff --git a/stdlib/test/test/lux/data/struct/set.lux b/stdlib/test/test/lux/data/coll/set.lux index ae709384f..d9540927e 100644 --- a/stdlib/test/test/lux/data/struct/set.lux +++ b/stdlib/test/test/lux/data/coll/set.lux @@ -5,10 +5,10 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) - (data (struct ["&" set] - [list "" Fold<List>]) + (data (coll ["&" set] + [list "" Fold<List>]) [number]) ["R" random] pipe) diff --git a/stdlib/test/test/lux/data/struct/stack.lux b/stdlib/test/test/lux/data/coll/stack.lux index 001eb1af1..f8057b1f2 100644 --- a/stdlib/test/test/lux/data/struct/stack.lux +++ b/stdlib/test/test/lux/data/coll/stack.lux @@ -5,10 +5,10 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) - (data (struct ["&" stack] - [list "" Fold<List>]) + (data (coll ["&" stack] + [list "" Fold<List>]) [number]) ["R" random] pipe) diff --git a/stdlib/test/test/lux/data/struct/tree/rose.lux b/stdlib/test/test/lux/data/coll/tree/rose.lux index 21592aba9..126a36678 100644 --- a/stdlib/test/test/lux/data/struct/tree/rose.lux +++ b/stdlib/test/test/lux/data/coll/tree/rose.lux @@ -5,10 +5,10 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) - (data (struct (tree ["&" rose]) - [list "List/" Monad<List>]) + (data (coll (tree ["&" rose]) + [list "List/" Monad<List>]) [number]) ["R" random] pipe) diff --git a/stdlib/test/test/lux/data/struct/tree/zipper.lux b/stdlib/test/test/lux/data/coll/tree/zipper.lux index f2d7fe708..949b558a7 100644 --- a/stdlib/test/test/lux/data/struct/tree/zipper.lux +++ b/stdlib/test/test/lux/data/coll/tree/zipper.lux @@ -5,11 +5,11 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) - (data (struct [list "List/" Fold<List> Functor<List>] - (tree ["&" zipper] - [rose])) + (data (coll [list "List/" Fold<List> Functor<List>] + (tree ["&" zipper] + [rose])) [text "Text/" Monoid<Text>] text/format [number]) diff --git a/stdlib/test/test/lux/data/struct/vector.lux b/stdlib/test/test/lux/data/coll/vector.lux index 35663c63a..9e1c3c44b 100644 --- a/stdlib/test/test/lux/data/struct/vector.lux +++ b/stdlib/test/test/lux/data/coll/vector.lux @@ -5,10 +5,10 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) - (data (struct ["&" vector] - [list "List/" Fold<List> Functor<List>]) + (data (coll ["&" vector] + [list "List/" Fold<List> Functor<List>]) [text "Text/" Monoid<Text>] text/format [number]) @@ -41,14 +41,14 @@ (assert "Can put and get elements into vectors." (|> sample (&;put idx non-member) - (&;at idx) + (&;nth idx) (default (undefined)) (is non-member))) (assert "Can update elements of vectors." (|> sample (&;put idx non-member) (&;update idx n.inc) - (&;at idx) (default (undefined)) + (&;nth idx) (default (undefined)) (n.= (n.inc non-member)))) (assert "Can safely transform to/from lists." diff --git a/stdlib/test/test/lux/data/error.lux b/stdlib/test/test/lux/data/error.lux index 880c2e0f1..a53d7faf2 100644 --- a/stdlib/test/test/lux/data/error.lux +++ b/stdlib/test/test/lux/data/error.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data text/format ["&" error]) diff --git a/stdlib/test/test/lux/data/error/exception.lux b/stdlib/test/test/lux/data/error/exception.lux index 312bca2a2..c3db059e6 100644 --- a/stdlib/test/test/lux/data/error/exception.lux +++ b/stdlib/test/test/lux/data/error/exception.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data [error #- fail] (error ["&" exception #+ exception:]) diff --git a/stdlib/test/test/lux/data/format/json.lux b/stdlib/test/test/lux/data/format/json.lux index 06c29707f..3734192a0 100644 --- a/stdlib/test/test/lux/data/format/json.lux +++ b/stdlib/test/test/lux/data/format/json.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad codec eq) @@ -17,9 +17,9 @@ [maybe] [number "i/" Number<Int>] (format ["&" json]) - (struct [vector #+ vector] - [dict] - [list])) + (coll [vector #+ vector] + [dict] + [list])) [compiler #+ with-gensyms] [macro] (macro [ast] diff --git a/stdlib/test/test/lux/data/ident.lux b/stdlib/test/test/lux/data/ident.lux index 70a8d2a58..1f8cc0441 100644 --- a/stdlib/test/test/lux/data/ident.lux +++ b/stdlib/test/test/lux/data/ident.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data ["&" ident] [text "Text/" Eq<Text>] diff --git a/stdlib/test/test/lux/data/identity.lux b/stdlib/test/test/lux/data/identity.lux index 4f8c26cb1..2444b80b7 100644 --- a/stdlib/test/test/lux/data/identity.lux +++ b/stdlib/test/test/lux/data/identity.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad comonad) (data ["&" identity] diff --git a/stdlib/test/test/lux/data/log.lux b/stdlib/test/test/lux/data/log.lux index dd94b1efa..abc1112a2 100644 --- a/stdlib/test/test/lux/data/log.lux +++ b/stdlib/test/test/lux/data/log.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data ["&" log] [text "Text/" Monoid<Text> Eq<Text>] diff --git a/stdlib/test/test/lux/data/maybe.lux b/stdlib/test/test/lux/data/maybe.lux index b0f2b411c..de738e336 100644 --- a/stdlib/test/test/lux/data/maybe.lux +++ b/stdlib/test/test/lux/data/maybe.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data ["&" maybe] [text "Text/" Monoid<Text>] diff --git a/stdlib/test/test/lux/data/number.lux b/stdlib/test/test/lux/data/number.lux index 8b7267444..4de7d4c14 100644 --- a/stdlib/test/test/lux/data/number.lux +++ b/stdlib/test/test/lux/data/number.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data number [text "Text/" Monoid<Text> Eq<Text>] diff --git a/stdlib/test/test/lux/data/product.lux b/stdlib/test/test/lux/data/product.lux index 3d064f96e..69b1029b9 100644 --- a/stdlib/test/test/lux/data/product.lux +++ b/stdlib/test/test/lux/data/product.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data product [text "Text/" Monoid<Text>] diff --git a/stdlib/test/test/lux/data/sum.lux b/stdlib/test/test/lux/data/sum.lux index 2ff10dbf5..abb00dbfa 100644 --- a/stdlib/test/test/lux/data/sum.lux +++ b/stdlib/test/test/lux/data/sum.lux @@ -5,12 +5,12 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data sum [text "Text/" Monoid<Text>] [number] - (struct [list])) + (coll [list])) (codata function) pipe) lux/test) diff --git a/stdlib/test/test/lux/data/text.lux b/stdlib/test/test/lux/data/text.lux index 14f58aedb..fc1d17e64 100644 --- a/stdlib/test/test/lux/data/text.lux +++ b/stdlib/test/test/lux/data/text.lux @@ -5,13 +5,13 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data ["&" text] [char] text/format [number] - (struct [list])) + (coll [list])) (codata function) ["R" random] pipe) @@ -34,7 +34,7 @@ idx (:: @ map (n.% size) R;nat) sample (R;text size)] (assert "" (|> sample - (&;at idx) + (&;nth idx) (case> (^=> (#;Some char) [(char;as-text char) char'] [[(&;index-of char' sample) @@ -132,20 +132,21 @@ ))) (test: "Structures" - ($_ seq - (assert "" (:: &;Ord<Text> < "bcd" "abc")) - (assert "" (not (:: &;Ord<Text> < "abc" "abc"))) - (assert "" (not (:: &;Ord<Text> < "abc" "bcd"))) - (assert "" (:: &;Ord<Text> <= "bcd" "abc")) - (assert "" (:: &;Ord<Text> <= "abc" "abc")) - (assert "" (not (:: &;Ord<Text> <= "abc" "bcd"))) - (assert "" (:: &;Ord<Text> > "abc" "bcd")) - (assert "" (not (:: &;Ord<Text> > "abc" "abc"))) - (assert "" (not (:: &;Ord<Text> > "bcd" "abc"))) - (assert "" (:: &;Ord<Text> >= "abc" "bcd")) - (assert "" (:: &;Ord<Text> >= "abc" "abc")) - (assert "" (not (:: &;Ord<Text> >= "bcd" "abc"))) - )) + (let [(^open "&/") &;Ord<Text>] + ($_ seq + (assert "" (&/< "bcd" "abc")) + (assert "" (not (&/< "abc" "abc"))) + (assert "" (not (&/< "abc" "bcd"))) + (assert "" (&/<= "bcd" "abc")) + (assert "" (&/<= "abc" "abc")) + (assert "" (not (&/<= "abc" "bcd"))) + (assert "" (&/> "abc" "bcd")) + (assert "" (not (&/> "abc" "abc"))) + (assert "" (not (&/> "bcd" "abc"))) + (assert "" (&/>= "abc" "bcd")) + (assert "" (&/>= "abc" "abc")) + (assert "" (not (&/>= "bcd" "abc"))) + ))) (test: "Codec" [size bounded-size diff --git a/stdlib/test/test/lux/data/text/format.lux b/stdlib/test/test/lux/data/text/format.lux index 12516a9ca..7ec6baf98 100644 --- a/stdlib/test/test/lux/data/text/format.lux +++ b/stdlib/test/test/lux/data/text/format.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data text/format [text] diff --git a/stdlib/test/test/lux/control/effect.lux b/stdlib/test/test/lux/effect.lux index be7eda3aa..275e1e66a 100644 --- a/stdlib/test/test/lux/control/effect.lux +++ b/stdlib/test/test/lux/effect.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io "IO/" Monad<IO>]) + (lux [io "IO/" Monad<IO>] (control monad functor) (data [text] @@ -13,7 +13,7 @@ [macro] ["R" random] pipe - (control effect)) + effect) lux/test) (do-template [<effect> <op> <field>] diff --git a/stdlib/test/test/lux/host.lux b/stdlib/test/test/lux/host.lux index 03ed87772..61f6aa7ec 100644 --- a/stdlib/test/test/lux/host.lux +++ b/stdlib/test/test/lux/host.lux @@ -5,13 +5,13 @@ (;module: lux - (lux (control monad) + (lux [io] + (control monad) (data text/format [number] [product] [text "Text/" Eq<Text>]) - (codata function - [io]) + (codata function) ["&" host #+ jvm-import class: interface: object] ["R" random] pipe) diff --git a/stdlib/test/test/lux/codata/io.lux b/stdlib/test/test/lux/io.lux index 7965869d0..0d7a3e5a9 100644 --- a/stdlib/test/test/lux/codata/io.lux +++ b/stdlib/test/test/lux/io.lux @@ -5,12 +5,12 @@ (;module: lux - (lux (control monad) + (lux ["&" io] + (control monad) (data [text "Text/" Monoid<Text> Eq<Text>] text/format [number]) - (codata function - ["&" io])) + (codata function)) lux/test) (test: "I/O" diff --git a/stdlib/test/test/lux/lexer.lux b/stdlib/test/test/lux/lexer.lux index 3c459ab8e..f08841a93 100644 --- a/stdlib/test/test/lux/lexer.lux +++ b/stdlib/test/test/lux/lexer.lux @@ -6,12 +6,12 @@ (;module: lux (lux (control monad) - (codata [io]) + [io] (data [error #- fail] [text "T/" Eq<Text>] text/format [char "C/" Eq<Char>] - (struct [list])) + (coll [list])) ["R" random] pipe ["&" lexer]) diff --git a/stdlib/test/test/lux/lexer/regex.lux b/stdlib/test/test/lux/lexer/regex.lux index 4a9f01c27..fd8e563ec 100644 --- a/stdlib/test/test/lux/lexer/regex.lux +++ b/stdlib/test/test/lux/lexer/regex.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data [error #- fail] [product] diff --git a/stdlib/test/test/lux/macro/ast.lux b/stdlib/test/test/lux/macro/ast.lux index 61127bef7..9c010c1e4 100644 --- a/stdlib/test/test/lux/macro/ast.lux +++ b/stdlib/test/test/lux/macro/ast.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (codata function) (control monad) (data [text "T/" Eq<Text>] diff --git a/stdlib/test/test/lux/macro/poly/eq.lux b/stdlib/test/test/lux/macro/poly/eq.lux index 4f4c296d6..ed34369a9 100644 --- a/stdlib/test/test/lux/macro/poly/eq.lux +++ b/stdlib/test/test/lux/macro/poly/eq.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad eq) (data text/format diff --git a/stdlib/test/test/lux/macro/poly/functor.lux b/stdlib/test/test/lux/macro/poly/functor.lux index 23d42c78d..ca269e15e 100644 --- a/stdlib/test/test/lux/macro/poly/functor.lux +++ b/stdlib/test/test/lux/macro/poly/functor.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad [functor] eq) diff --git a/stdlib/test/test/lux/macro/poly/text-encoder.lux b/stdlib/test/test/lux/macro/poly/text-encoder.lux index 154d9ab10..ef9474f42 100644 --- a/stdlib/test/test/lux/macro/poly/text-encoder.lux +++ b/stdlib/test/test/lux/macro/poly/text-encoder.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad eq) (data text/format diff --git a/stdlib/test/test/lux/macro/syntax.lux b/stdlib/test/test/lux/macro/syntax.lux index 2755bbf8e..1d96883de 100644 --- a/stdlib/test/test/lux/macro/syntax.lux +++ b/stdlib/test/test/lux/macro/syntax.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad eq) (data [text "Text/" Monoid<Text>] @@ -73,8 +73,8 @@ (let% [<simple-tests> (do-template [<assertion> <value> <ctor> <Eq> <get>] [(assert <assertion> (and (is? <Eq> <value> <get> (list (<ctor> <value>))) - (found? (s;sample? (<ctor> <value>)) (list (<ctor> <value>))) - (enforced? (s;sample! (<ctor> <value>)) (list (<ctor> <value>)))))] + (found? (s;this? (<ctor> <value>)) (list (<ctor> <value>))) + (enforced? (s;this! (<ctor> <value>)) (list (<ctor> <value>)))))] ["Can parse Bool syntax." true ast;bool bool;Eq<Bool> s;bool] ["Can parse Nat syntax." +123 ast;nat number;Eq<Nat> s;nat] @@ -252,8 +252,8 @@ (assert "Can parse while taking separators into account." (and (match (list 123 456 789) (s;run (list (ast;int 123) (ast;text "YOLO") (ast;int 456) (ast;text "YOLO") (ast;int 789)) - (s;sep-by (s;sample! (' "YOLO")) s;int))) + (s;sep-by (s;this! (' "YOLO")) s;int))) (match (list 123 456) (s;run (list (ast;int 123) (ast;text "YOLO") (ast;int 456) (ast;int 789)) - (s;sep-by (s;sample! (' "YOLO")) s;int))))) + (s;sep-by (s;this! (' "YOLO")) s;int))))) )) diff --git a/stdlib/test/test/lux/math.lux b/stdlib/test/test/lux/math.lux index 1ffba0aa2..f16517d85 100644 --- a/stdlib/test/test/lux/math.lux +++ b/stdlib/test/test/lux/math.lux @@ -5,13 +5,13 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data [text "Text/" Monoid<Text>] text/format [bool "b/" Eq<Bool>] [number "r/" Number<Real>] - (struct [list "List/" Fold<List> Functor<List>]) + (coll [list "List/" Fold<List> Functor<List>]) [product]) (codata function) ["R" random] diff --git a/stdlib/test/test/lux/math/complex.lux b/stdlib/test/test/lux/math/complex.lux index f9743e9ec..0fb327425 100644 --- a/stdlib/test/test/lux/math/complex.lux +++ b/stdlib/test/test/lux/math/complex.lux @@ -5,13 +5,13 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data [text "Text/" Monoid<Text>] text/format [bool "b/" Eq<Bool>] [number "r/" Number<Real>] - (struct [list "List/" Fold<List> Functor<List>]) + (coll [list "List/" Fold<List> Functor<List>]) [product]) (codata function) [math] diff --git a/stdlib/test/test/lux/math/logic/continuous.lux b/stdlib/test/test/lux/math/logic/continuous.lux index 883d54a06..57905a4d7 100644 --- a/stdlib/test/test/lux/math/logic/continuous.lux +++ b/stdlib/test/test/lux/math/logic/continuous.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (codata function) ["R" random] diff --git a/stdlib/test/test/lux/math/ratio.lux b/stdlib/test/test/lux/math/ratio.lux index 0cdbf4f93..cd9c6138b 100644 --- a/stdlib/test/test/lux/math/ratio.lux +++ b/stdlib/test/test/lux/math/ratio.lux @@ -5,13 +5,13 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data [text "Text/" Monoid<Text>] text/format [bool "b/" Eq<Bool>] [number "r/" Number<Real>] - (struct [list "List/" Fold<List> Functor<List>]) + (coll [list "List/" Fold<List> Functor<List>]) [product]) (codata function) ["R" random] diff --git a/stdlib/test/test/lux/math/simple.lux b/stdlib/test/test/lux/math/simple.lux index 235723f25..0fc6ee2be 100644 --- a/stdlib/test/test/lux/math/simple.lux +++ b/stdlib/test/test/lux/math/simple.lux @@ -5,13 +5,13 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data [text "Text/" Monoid<Text>] text/format [bool "b/" Eq<Bool>] [number "r/" Number<Real>] - (struct [list "List/" Fold<List> Functor<List>]) + (coll [list "List/" Fold<List> Functor<List>]) [product]) (codata function) ["R" random] diff --git a/stdlib/test/test/lux/pipe.lux b/stdlib/test/test/lux/pipe.lux index 86f45079f..0fc95add2 100644 --- a/stdlib/test/test/lux/pipe.lux +++ b/stdlib/test/test/lux/pipe.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data text/format [number] diff --git a/stdlib/test/test/lux/type.lux b/stdlib/test/test/lux/type.lux index 1670f3146..081d9d444 100644 --- a/stdlib/test/test/lux/type.lux +++ b/stdlib/test/test/lux/type.lux @@ -5,13 +5,13 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data [text "Text/" Monoid<Text>] text/format [number] maybe - (struct [list])) + (coll [list])) ["R" random] pipe ["&" type]) diff --git a/stdlib/test/test/lux/type/auto.lux b/stdlib/test/test/lux/type/auto.lux index fdc1ec51a..12b52292e 100644 --- a/stdlib/test/test/lux/type/auto.lux +++ b/stdlib/test/test/lux/type/auto.lux @@ -5,7 +5,7 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad functor [eq]) @@ -14,7 +14,7 @@ [number] [bool "B/" Eq<Bool>] maybe - (struct [list])) + (coll [list])) ["R" random] pipe [type] diff --git a/stdlib/test/test/lux/type/check.lux b/stdlib/test/test/lux/type/check.lux index 2dadd92f2..e69bcfc45 100644 --- a/stdlib/test/test/lux/type/check.lux +++ b/stdlib/test/test/lux/type/check.lux @@ -5,13 +5,13 @@ (;module: lux - (lux (codata [io]) + (lux [io] (control monad) (data [text "Text/" Monoid<Text> Eq<Text>] text/format [number] maybe - (struct [list])) + (coll [list])) ["R" random] pipe [type] diff --git a/stdlib/test/tests.lux b/stdlib/test/tests.lux index fdcf01457..d6a21cae4 100644 --- a/stdlib/test/tests.lux +++ b/stdlib/test/tests.lux @@ -6,27 +6,27 @@ (;module: lux (lux (control monad) - (codata [io]) + [io] (concurrency [promise]) [cli #+ program:] [test]) (test lux (lux ["_;" cli] ["_;" host] + ["_;" io] ["_;" pipe] ["_;" lexer] (lexer ["_;" regex]) - (codata ["_;" io] + (codata ["_;" cont] ["_;" env] ["_;" state] - ["_;" cont] - (struct ["_;" stream])) + (coll ["_;" stream])) (concurrency ["_;" actor] ["_;" atom] ["_;" frp] ["_;" promise] ["_;" stm]) - (control [effect]) + ["_;" effect] (data [bit] [bool] [char] @@ -41,15 +41,15 @@ [text] (error [exception]) (format [json]) - (struct [array] - [dict] - [list] - [queue] - [set] - [stack] - ## [vector] - (tree [rose] - [zipper])) + (coll [array] + [dict] + [list] + [queue] + [set] + [stack] + ## [vector] + (tree [rose] + [zipper])) (text [format]) ) ["_;" math] |