diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/test/lux/type/check.lux | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/stdlib/source/test/lux/type/check.lux b/stdlib/source/test/lux/type/check.lux index 4846f5e7d..bbaaa5712 100644 --- a/stdlib/source/test/lux/type/check.lux +++ b/stdlib/source/test/lux/type/check.lux @@ -10,13 +10,13 @@ [data ["." product] ["." maybe] - ["." text ("#@." equivalence)] + ["." text ("#\." equivalence)] [number ["n" nat]] [collection - ["." list ("#@." functor)] + ["." list ("#\." functor)] ["." set]]] - ["." type ("#@." equivalence)]] + ["." type ("#\." equivalence)]] {1 ["." /]}) @@ -33,28 +33,28 @@ (-> Nat (r.Random Type)) (do r.monad [_ (wrap [])] - (let [(^open "R@.") r.monad + (let [(^open "R\.") r.monad pairG (r.and (type' num-vars) (type' num-vars)) - quantifiedG (r.and (R@wrap (list)) (type' (inc num-vars))) - random-pair (r.either (r.either (R@map (|>> #.Sum) pairG) - (R@map (|>> #.Product) pairG)) - (r.either (R@map (|>> #.Function) pairG) - (R@map (|>> #.Apply) pairG))) - random-id (let [random-id (r.either (R@map (|>> #.Var) r.nat) - (R@map (|>> #.Ex) r.nat))] + quantifiedG (r.and (R\wrap (list)) (type' (inc num-vars))) + random-pair (r.either (r.either (R\map (|>> #.Sum) pairG) + (R\map (|>> #.Product) pairG)) + (r.either (R\map (|>> #.Function) pairG) + (R\map (|>> #.Apply) pairG))) + random-id (let [random-id (r.either (R\map (|>> #.Var) r.nat) + (R\map (|>> #.Ex) r.nat))] (case num-vars 0 random-id - _ (r.either (R@map (|>> (n.% num-vars) (n.* 2) inc #.Parameter) r.nat) + _ (r.either (R\map (|>> (n.% num-vars) (n.* 2) inc #.Parameter) r.nat) random-id))) - random-quantified (r.either (R@map (|>> #.UnivQ) quantifiedG) - (R@map (|>> #.ExQ) quantifiedG))] + random-quantified (r.either (R\map (|>> #.UnivQ) quantifiedG) + (R\map (|>> #.ExQ) quantifiedG))] ($_ r.either - (R@map (|>> #.Primitive) (r.and ..short (R@wrap (list)))) + (R\map (|>> #.Primitive) (r.and ..short (R\wrap (list)))) random-pair random-id random-quantified - (R@map (|>> #.Named) (r.and ..name (type' num-vars))) + (R\map (|>> #.Named) (r.and ..name (type' num-vars))) )))) (def: type @@ -157,7 +157,7 @@ (do r.monad [#let [gen-short (r.ascii 10)] nameL gen-short - nameR (|> gen-short (r.filter (|>> (text@= nameL) not))) + nameR (|> gen-short (r.filter (|>> (text\= nameL) not))) paramL ..type paramR (r.filter (|>> (/.checks? paramL) not) ..type)] ($_ _.and @@ -207,7 +207,7 @@ (_.test "Can create rings of variables." (type-checks? (do /.monad [[[head-id head-type] ids+types [tail-id tail-type]] (build-ring num-connections) - #let [ids (list@map product.left ids+types)] + #let [ids (list\map product.left ids+types)] headR (/.ring head-id) tailR (/.ring tail-id)] (/.assert "" @@ -222,7 +222,7 @@ (_.test "When a var in a ring is bound, all the ring is bound." (type-checks? (do {! /.monad} [[[head-id headT] ids+types tailT] (build-ring num-connections) - #let [ids (list@map product.left ids+types)] + #let [ids (list\map product.left ids+types)] _ (/.check headT boundT) head-bound (/.read head-id) tail-bound (monad.map ! /.read ids) @@ -230,8 +230,8 @@ tailR+ (monad.map ! /.ring ids)] (let [rings-were-erased? (and (set.empty? headR) (list.every? set.empty? tailR+)) - same-types? (list.every? (type@= boundT) (list& (maybe.default headT head-bound) - (list@map (function (_ [tail-id ?tailT]) + same-types? (list.every? (type\= boundT) (list& (maybe.default headT head-bound) + (list\map (function (_ [tail-id ?tailT]) (maybe.default (#.Var tail-id) ?tailT)) (list.zip/2 ids tail-bound))))] (/.assert "" |