From 62b3abfcc014ca1c19d62aacdd497f6a250b372c Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 25 Jul 2021 03:12:17 -0400 Subject: Better syntax for "library/lux.^multi". --- .../specification/compositor/generation/case.lux | 6 +++--- .../specification/compositor/generation/common.lux | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'stdlib/source/specification/compositor/generation') diff --git a/stdlib/source/specification/compositor/generation/case.lux b/stdlib/source/specification/compositor/generation/case.lux index 2424aa330..81e6f5988 100644 --- a/stdlib/source/specification/compositor/generation/case.lux +++ b/stdlib/source/specification/compositor/generation/case.lux @@ -111,7 +111,7 @@ (-> Runner Test) (do r.monad [on-true r.safe-frac - on-false (|> r.safe-frac (r.filter (|>> (f.= on-true) not))) + on-false (|> r.safe-frac (r.only (|>> (f.= on-true) not))) verdict r.bit] (_.test (%.name (name-of synthesis.branch/if)) (|> (synthesis.branch/if [(synthesis.bit verdict) @@ -125,7 +125,7 @@ (do r.monad [[inputS pathS] ..case on-success r.safe-frac - on-failure (|> r.safe-frac (r.filter (|>> (f.= on-success) not)))] + on-failure (|> r.safe-frac (r.only (|>> (f.= on-success) not)))] (_.test (%.name (name-of synthesis.branch/case)) (|> (synthesis.branch/case [inputS @@ -231,7 +231,7 @@ (def: special-pattern-path Path ($_ synthesis.path/alt - (<| try.assume + (<| try.assumed (phase.run [extension/synthesis.bundle synthesis.init]) (case.path phase/synthesis.phase diff --git a/stdlib/source/specification/compositor/generation/common.lux b/stdlib/source/specification/compositor/generation/common.lux index 3d377b7ca..e14aa8e52 100644 --- a/stdlib/source/specification/compositor/generation/common.lux +++ b/stdlib/source/specification/compositor/generation/common.lux @@ -75,7 +75,7 @@ (def: (i64 run) (-> Runner Test) (do r.monad - [param (|> r.i64 (r.filter (|>> ("lux i64 =" 0) not))) + [param (|> r.i64 (r.only (|>> ("lux i64 =" 0) not))) subject r.i64] (`` ($_ _.and (~~ (template [ ] @@ -123,7 +123,7 @@ (def: (f64 run) (-> Runner Test) (do r.monad - [param (|> ..simple-frac (r.filter (|>> (f.= +0.0) not))) + [param (|> ..simple-frac (r.only (|>> (f.= +0.0) not))) subject ..simple-frac] (`` ($_ _.and (~~ (template [ ] @@ -179,7 +179,7 @@ sample-lower (r.ascii/lower-alpha sample-size) sample-upper (r.ascii/upper-alpha sample-size) sample-alpha (|> (r.ascii/alpha sample-size) - (r.filter (|>> (text\= sample-upper) not))) + (r.only (|>> (text\= sample-upper) not))) char-idx (|> r.nat (\ ! map (n.% sample-size))) #let [sample-lowerS (synthesis.text sample-lower) sample-upperS (synthesis.text sample-upper) @@ -235,7 +235,7 @@ (synthesis.i64 +0))) (run (..sanitize "lux text index")) (case> (^multi (#try.Success valueV) - [(:as (Maybe Nat) valueV) (#.Some valueV)]) + {(:as (Maybe Nat) valueV) (#.Some valueV)}) (n.= 0 valueV) _ @@ -245,7 +245,7 @@ (synthesis.i64 +0))) (run (..sanitize "lux text index")) (case> (^multi (#try.Success valueV) - [(:as (Maybe Nat) valueV) (#.Some valueV)]) + {(:as (Maybe Nat) valueV) (#.Some valueV)}) (n.= sample-size valueV) _ @@ -258,7 +258,7 @@ (synthesis.i64 length))) (run (..sanitize "lux text clip")) (case> (^multi (#try.Success valueV) - [(:as (Maybe Text) valueV) (#.Some valueV)]) + {(:as (Maybe Text) valueV) (#.Some valueV)}) (text\= expected valueV) _ @@ -272,7 +272,7 @@ (synthesis.i64 char-idx))) (run (..sanitize "lux text char")) (case> (^multi (#try.Success valueV) - [(:as (Maybe Int) valueV) (#.Some valueV)]) + {(:as (Maybe Int) valueV) (#.Some valueV)}) (text.contains? ("lux i64 char" valueV) sample-lower) @@ -303,7 +303,7 @@ (list (synthesis.text message)))}))) (run (..sanitize "lux try")) (case> (^multi (#try.Success valueV) - [(:as (Try Text) valueV) (#try.Failure error)]) + {(:as (Try Text) valueV) (#try.Failure error)}) (text.contains? message error) _ @@ -315,7 +315,7 @@ #synthesis.body (synthesis.text message)}))) (run (..sanitize "lux try")) (case> (^multi (#try.Success valueV) - [(:as (Try Text) valueV) (#try.Success valueV)]) + {(:as (Try Text) valueV) (#try.Success valueV)}) (text\= message valueV) _ -- cgit v1.2.3