aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/specification/compositor/generation/case.lux
diff options
context:
space:
mode:
authorEduardo Julian2022-03-14 18:27:37 -0400
committerEduardo Julian2022-03-14 18:27:37 -0400
commit41495e32d3f5f88b5f189f48dd4fdbfa883c6ac0 (patch)
tree7a561e83768d5ac4eb08855858dde38d2987fc46 /stdlib/source/specification/compositor/generation/case.lux
parent62299ecdc93b39f6a22b1f89779f55dfa735fb3c (diff)
De-sigil-ification: >
Diffstat (limited to 'stdlib/source/specification/compositor/generation/case.lux')
-rw-r--r--stdlib/source/specification/compositor/generation/case.lux98
1 files changed, 51 insertions, 47 deletions
diff --git a/stdlib/source/specification/compositor/generation/case.lux b/stdlib/source/specification/compositor/generation/case.lux
index 7d6c81a7b..46fd92eb2 100644
--- a/stdlib/source/specification/compositor/generation/case.lux
+++ b/stdlib/source/specification/compositor/generation/case.lux
@@ -1,32 +1,32 @@
(.using
- [lux {"-" case}
- ["_" test {"+" Test}]
- [abstract
- [monad {"+" do}]]
- [control
- [pipe {"+" case>}]
- ["[0]" try {"+" Try}]]
- [data
- ["[0]" text ("[1]#[0]" equivalence)
- ["%" format {"+" format}]]
- [number
- ["n" nat]
- ["f" frac]]
- [collection
- ["[0]" list ("[1]#[0]" mix)]]]
- [math
- ["r" random {"+" Random}]]
- [tool
- [compiler
- ["[0]" reference]
- ["[0]" analysis]
- ["[0]" synthesis {"+" Path Synthesis}]
- ["[0]" phase
- ["[1]/[0]" synthesis
- ["[0]" case]]
- ["[0]" extension/synthesis]]]]]
- [///
- [common {"+" Runner}]])
+ [lux {"-" case}
+ ["_" test {"+" Test}]
+ [abstract
+ [monad {"+" do}]]
+ [control
+ ["[0]" pipe]
+ ["[0]" try {"+" Try}]]
+ [data
+ ["[0]" text ("[1]#[0]" equivalence)
+ ["%" format {"+" format}]]
+ [number
+ ["n" nat]
+ ["f" frac]]
+ [collection
+ ["[0]" list ("[1]#[0]" mix)]]]
+ [math
+ ["r" random {"+" Random}]]
+ [tool
+ [compiler
+ ["[0]" reference]
+ ["[0]" analysis]
+ ["[0]" synthesis {"+" Path Synthesis}]
+ ["[0]" phase
+ ["[1]/[0]" synthesis
+ ["[0]" case]]
+ ["[0]" extension/synthesis]]]]]
+ [///
+ [common {"+" Runner}]])
(def: limit Nat 10)
@@ -40,11 +40,12 @@
(def: .public (verify expected)
(-> Frac (Try Any) Bit)
- (|>> (case> {try.#Success actual}
- (f.= expected (:as Frac actual))
+ (|>> (pipe.case
+ {try.#Success actual}
+ (f.= expected (:as Frac actual))
- {try.#Failure _}
- false)))
+ {try.#Failure _}
+ false)))
(def: case
(Random [Synthesis Path])
@@ -249,29 +250,32 @@
(_.test "CODE"
(|> special_input
(run "special_input")
- (case> {try.#Success output}
- true
-
- {try.#Failure _}
- false)))
+ (pipe.case
+ {try.#Success output}
+ true
+
+ {try.#Failure _}
+ false)))
(_.test "PATTERN_MATCHING 0"
(|> (synthesis.branch/case [special_input
special_path])
(run "special_path")
- (case> {try.#Success output}
- true
-
- {try.#Failure _}
- false)))
+ (pipe.case
+ {try.#Success output}
+ true
+
+ {try.#Failure _}
+ false)))
(_.test "PATTERN_MATCHING 1"
(|> (synthesis.branch/case [special_input
special_pattern_path])
(run "special_pattern_path")
- (case> {try.#Success output}
- true
-
- {try.#Failure _}
- false)))
+ (pipe.case
+ {try.#Success output}
+ true
+
+ {try.#Failure _}
+ false)))
))
(def: .public (spec run)