diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/spec/compositor/generation/case.lux | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/stdlib/source/spec/compositor/generation/case.lux b/stdlib/source/spec/compositor/generation/case.lux index 00a5e4d7c..414b468e2 100644 --- a/stdlib/source/spec/compositor/generation/case.lux +++ b/stdlib/source/spec/compositor/generation/case.lux @@ -10,6 +10,7 @@ ["." text ("#@." equivalence) ["%" format (#+ format)]] [number + ["n" nat] ["f" frac]] [collection ["." list ("#@." fold)]]] @@ -31,11 +32,11 @@ (def: size (Random Nat) - (|> r.nat (:: r.monad map (|>> (n/% ..limit) (n/max 2))))) + (|> r.nat (:: r.monad map (|>> (n.% ..limit) (n.max 2))))) (def: (tail? size idx) (-> Nat Nat Bit) - (n/= (dec size) idx)) + (n.= (dec size) idx)) (def: #export (verify expected) (-> Frac (Try Any) Bit) @@ -65,13 +66,13 @@ [(r.unicode 5) synthesis.text synthesis.path/text])) (do r.monad [size ..size - idx (|> r.nat (:: @ map (n/% size))) + idx (|> r.nat (:: @ map (n.% size))) [subS subP] case #let [unitS (synthesis.text synthesis.unit) caseS (synthesis.tuple (list.concat (list (list.repeat idx unitS) (list subS) - (list.repeat (|> size dec (n/- idx)) unitS)))) + (list.repeat (|> size dec (n.- idx)) unitS)))) caseP ($_ synthesis.path/seq (if (tail? size idx) (synthesis.member/right idx) @@ -80,7 +81,7 @@ (wrap [caseS caseP])) (do r.monad [size ..size - idx (|> r.nat (:: @ map (n/% size))) + idx (|> r.nat (:: @ map (n.% size))) [subS subP] case #let [right? (tail? size idx) caseS (synthesis.variant |