diff options
Diffstat (limited to 'new-luxc/test/test/luxc/analyser/function.lux')
-rw-r--r-- | new-luxc/test/test/luxc/analyser/function.lux | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/new-luxc/test/test/luxc/analyser/function.lux b/new-luxc/test/test/luxc/analyser/function.lux index 827e9a245..f26025034 100644 --- a/new-luxc/test/test/luxc/analyser/function.lux +++ b/new-luxc/test/test/luxc/analyser/function.lux @@ -4,15 +4,14 @@ (control [monad #+ do] pipe) (data ["R" result] + [maybe] [product] - [text "T/" Eq<Text>] + [text "text/" Eq<Text>] text/format - (coll [list "L/" Functor<List>] - ["S" set])) + (coll [list "list/" Functor<List>])) ["r" math/random "r/" Monad<Random>] - [type "Type/" Eq<Type>] - (type ["TC" check]) - [macro #+ Monad<Lux>] + [type "type/" Eq<Type>] + [macro] (macro [code]) test) (luxc ["&" base] @@ -28,7 +27,7 @@ (-> Type (R;Result [Type la;Analysis]) Bool) (case result (#R;Success [exprT exprA]) - (Type/= expectedT exprT) + (type/= expectedT exprT) _ false)) @@ -58,7 +57,7 @@ (macro;run (init-compiler [])) (case> (#R;Success [applyT applyA]) (let [[funcA argsA] (flatten-apply applyA)] - (and (Type/= expectedT applyT) + (and (type/= expectedT applyT) (n.= num-args (list;size argsA)))) (#R;Error error) @@ -66,7 +65,7 @@ (context: "Function definition." [func-name (r;text +5) - arg-name (|> (r;text +5) (r;filter (|>. (T/= func-name) not))) + arg-name (|> (r;text +5) (r;filter (|>. (text/= func-name) not))) [outputT outputC] gen-primitive [inputT _] gen-primitive] ($_ seq @@ -111,8 +110,8 @@ partial-args (|> r;nat (:: @ map (n.% full-args))) var-idx (|> r;nat (:: @ map (|>. (n.% full-args) (n.max +1)))) inputsTC (r;list full-args gen-primitive) - #let [inputsT (L/map product;left inputsTC) - inputsC (L/map product;right inputsTC)] + #let [inputsT (list/map product;left inputsTC) + inputsC (list/map product;right inputsTC)] [outputT outputC] gen-primitive #let [funcT (type;function inputsT outputT) partialT (type;function (list;drop partial-args inputsT) outputT) @@ -122,7 +121,7 @@ (list varT) (list;drop (n.inc var-idx) inputsT)))) varT) - poly-inputT (assume (list;nth var-idx inputsT)) + poly-inputT (maybe;assume (list;nth var-idx inputsT)) partial-poly-inputsT (list;drop (n.inc var-idx) inputsT) partial-polyT1 (<| (type;function partial-poly-inputsT) poly-inputT) |