diff options
Diffstat (limited to '')
-rw-r--r-- | new-luxc/test/test/luxc/generator/function.lux | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/new-luxc/test/test/luxc/generator/function.lux b/new-luxc/test/test/luxc/generator/function.lux index 3f938d9df..3757c0937 100644 --- a/new-luxc/test/test/luxc/generator/function.lux +++ b/new-luxc/test/test/luxc/generator/function.lux @@ -3,16 +3,13 @@ (lux [io] (control [monad #+ do] pipe) - (data text/format - [product] + (data [product] + [maybe] ["R" result] - [bool "B/" Eq<Bool>] - [text "T/" Eq<Text>] (coll ["a" array] - [list "L/" Functor<List>] - ["S" set])) + [list "list/" Functor<List>])) ["r" math/random "r/" Monad<Random>] - [macro #+ Monad<Lux>] + [macro] (macro [code]) [host] test) @@ -43,13 +40,13 @@ [[arity arg functionS] gen-function cut-off (|> r;nat (:: @ map (n.% arity))) args (r;list arity r;nat) - #let [arg-value (assume (list;nth arg args)) - argsS (L/map (|>. #ls;Nat) args) + #let [arg-value (maybe;assume (list;nth arg args)) + argsS (list/map (|>. #ls;Nat) args) last-arg (n.dec arity) cut-off (|> cut-off (n.min (n.dec last-arg)))]] ($_ seq (test "Can read arguments." - (|> (do Monad<Lux> + (|> (do macro;Monad<Lux> [runtime-bytecode @runtime;generate sampleI (@expr;generate (#ls;Call argsS functionS))] (@eval;eval sampleI)) @@ -61,7 +58,7 @@ false))) (test "Can partially apply functions." (or (n.= +1 arity) - (|> (do Monad<Lux> + (|> (do macro;Monad<Lux> [#let [partial-arity (n.inc cut-off) preS (list;take partial-arity argsS) postS (list;drop partial-arity argsS)] @@ -76,9 +73,9 @@ false)))) (test "Can read environment." (or (n.= +1 arity) - (|> (do Monad<Lux> + (|> (do macro;Monad<Lux> [#let [env (|> (list;n.range +0 cut-off) - (L/map (|>. n.inc nat-to-int))) + (list/map (|>. n.inc nat-to-int))) super-arity (n.inc cut-off) arg-var (if (n.<= cut-off arg) (|> arg n.inc nat-to-int (i.* -1)) |