diff options
author | Eduardo Julian | 2017-07-15 20:45:10 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-07-15 20:45:10 -0400 |
commit | 4c36eaf769bc74e708d1f63e67ff612176963731 (patch) | |
tree | 797ca6d0222bae3293646e690ad58690f89b6b2c /stdlib/test | |
parent | fbd8a37baf6d50d62716d69b451d4ac58b872283 (diff) |
- Can now generate Eq instances for #rec-style recursive types.
- Minor refactorings.
Diffstat (limited to 'stdlib/test')
-rw-r--r-- | stdlib/test/test/lux/control/parser.lux | 2 | ||||
-rw-r--r-- | stdlib/test/test/lux/data/coll/ordered/dict.lux | 2 | ||||
-rw-r--r-- | stdlib/test/test/lux/data/format/json.lux | 2 | ||||
-rw-r--r-- | stdlib/test/test/lux/macro/poly/eq.lux | 19 | ||||
-rw-r--r-- | stdlib/test/test/lux/macro/poly/functor.lux | 2 | ||||
-rw-r--r-- | stdlib/test/test/lux/macro/poly/text-encoder.lux | 2 | ||||
-rw-r--r-- | stdlib/test/test/lux/macro/syntax.lux | 2 |
7 files changed, 22 insertions, 9 deletions
diff --git a/stdlib/test/test/lux/control/parser.lux b/stdlib/test/test/lux/control/parser.lux index 4580dca1e..ad5a57a1c 100644 --- a/stdlib/test/test/lux/control/parser.lux +++ b/stdlib/test/test/lux/control/parser.lux @@ -2,7 +2,7 @@ lux (lux [io] (control monad - eq + [eq #+ Eq] ["&" parser] pipe) (data [text "Text/" Monoid<Text>] diff --git a/stdlib/test/test/lux/data/coll/ordered/dict.lux b/stdlib/test/test/lux/data/coll/ordered/dict.lux index 8793be9c2..76e9083eb 100644 --- a/stdlib/test/test/lux/data/coll/ordered/dict.lux +++ b/stdlib/test/test/lux/data/coll/ordered/dict.lux @@ -2,7 +2,7 @@ lux (lux [io] (control monad - eq) + [eq #+ Eq]) (data [product] [number] (coll (ordered ["&" dict]) diff --git a/stdlib/test/test/lux/data/format/json.lux b/stdlib/test/test/lux/data/format/json.lux index c61429b87..fc533e4c1 100644 --- a/stdlib/test/test/lux/data/format/json.lux +++ b/stdlib/test/test/lux/data/format/json.lux @@ -3,7 +3,7 @@ (lux [io] (control monad codec - eq + [eq #+ Eq] pipe) (data [text "Text/" Monoid<Text>] text/format diff --git a/stdlib/test/test/lux/macro/poly/eq.lux b/stdlib/test/test/lux/macro/poly/eq.lux index e3c059ddd..9bd6fc5e6 100644 --- a/stdlib/test/test/lux/macro/poly/eq.lux +++ b/stdlib/test/test/lux/macro/poly/eq.lux @@ -2,7 +2,7 @@ lux (lux [io] (control monad - eq) + [eq #+ Eq]) (data text/format [bool] [number "i/" Number<Int>] @@ -19,6 +19,10 @@ (#Case1 Int) (#Case2 Real)) +(type: #rec Recursive + (#Number Real) + (#Addition Real Recursive)) + (type: Record {#unit Unit #bool Bool @@ -28,7 +32,16 @@ #maybe (Maybe Int) #list (List Int) #variant Variant - #tuple [Int Real Text]}) + #tuple [Int Real Text] + #recursive Recursive}) + +(def: gen-recursive + (r;Random Recursive) + (r;rec (function [gen-recursive] + (r;alt r;real + (r;seq r;real gen-recursive))))) + +(derived: (&;Eq<?> Recursive)) (def: gen-record (r;Random Record) @@ -45,7 +58,7 @@ (r;list size gen-int) ($_ r;alt r;bool gen-int r;real) ($_ r;seq gen-int r;real (r;text size)) - ))) + gen-recursive))) (derived: (&;Eq<?> Record)) diff --git a/stdlib/test/test/lux/macro/poly/functor.lux b/stdlib/test/test/lux/macro/poly/functor.lux index 34d0d1a82..e97093d81 100644 --- a/stdlib/test/test/lux/macro/poly/functor.lux +++ b/stdlib/test/test/lux/macro/poly/functor.lux @@ -3,7 +3,7 @@ (lux [io] (control monad [functor] - eq) + [eq #+ Eq]) (data text/format [bool] [number "i/" Number<Int>] diff --git a/stdlib/test/test/lux/macro/poly/text-encoder.lux b/stdlib/test/test/lux/macro/poly/text-encoder.lux index a98b8801d..1b38aa9b9 100644 --- a/stdlib/test/test/lux/macro/poly/text-encoder.lux +++ b/stdlib/test/test/lux/macro/poly/text-encoder.lux @@ -2,7 +2,7 @@ lux (lux [io] (control monad - eq) + [eq #+ Eq]) (data text/format [bool] [number "i/" Number<Int>] diff --git a/stdlib/test/test/lux/macro/syntax.lux b/stdlib/test/test/lux/macro/syntax.lux index ff8befbda..f99385521 100644 --- a/stdlib/test/test/lux/macro/syntax.lux +++ b/stdlib/test/test/lux/macro/syntax.lux @@ -2,7 +2,7 @@ lux (lux [io] (control monad - eq + [eq #+ Eq] ["p" parser]) (data [text "Text/" Monoid<Text>] text/format |