From ae8306fe81376eefb7416a1d5c6b8d2ed3cd8f6c Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 2 Aug 2017 23:21:54 -0400 Subject: - Re-implemented polytypic matchers in terms of lux/control/parser. --- stdlib/test/test/lux/macro/poly/eq.lux | 4 +++- stdlib/test/test/lux/macro/poly/functor.lux | 25 +++++++++---------------- 2 files changed, 12 insertions(+), 17 deletions(-) (limited to 'stdlib/test') diff --git a/stdlib/test/test/lux/macro/poly/eq.lux b/stdlib/test/test/lux/macro/poly/eq.lux index 44ecbff1e..367ac1674 100644 --- a/stdlib/test/test/lux/macro/poly/eq.lux +++ b/stdlib/test/test/lux/macro/poly/eq.lux @@ -6,7 +6,9 @@ (data text/format [bool] [number "i/" Number] - [text]) + [text] + [maybe] + (coll [list])) ["r" math/random] [macro] (macro [poly #+ derived:] diff --git a/stdlib/test/test/lux/macro/poly/functor.lux b/stdlib/test/test/lux/macro/poly/functor.lux index 11cdcf824..45e54bae7 100644 --- a/stdlib/test/test/lux/macro/poly/functor.lux +++ b/stdlib/test/test/lux/macro/poly/functor.lux @@ -3,11 +3,13 @@ (lux [io] (control [monad #+ do Monad] [functor] - [eq #+ Eq]) + [eq #+ Eq] + [state]) (data text/format [bool] [number "i/" Number] - [text]) + [text] + [identity]) ["r" math/random] [macro] (macro [poly #+ derived:] @@ -15,23 +17,14 @@ lux/test) ## [Utils] -(type: (My-Maybe a) - #My-None - (#My-Some a)) +(derived: (&;Functor ;Maybe)) -(type: (My-List a) - #My-Nil - (#My-Cons [a (My-List a)])) +(derived: (&;Functor ;List)) -(type: (My-State s a) - (-> s [s a])) +(derived: (&;Functor state;State)) -(derived: (&;Functor My-Maybe)) - -(derived: (&;Functor My-List)) - -(derived: (&;Functor My-State)) +(derived: (&;Functor identity;Identity)) ## [Tests] -(context: "Functor polytypism" +(context: "Functor polytypism." (test "" true)) -- cgit v1.2.3