aboutsummaryrefslogtreecommitdiff
path: root/stdlib/test
diff options
context:
space:
mode:
authorEduardo Julian2017-07-22 18:18:57 -0400
committerEduardo Julian2017-07-22 18:18:57 -0400
commita2615d3ac0b1ecf9e4b9e1e3f3a2797f62801bed (patch)
tree1b19d436c5160e5d6073c2b8fa72785be4d0b134 /stdlib/test
parenta878ffc5f8d71848db3f400bc3ebd40176c19973 (diff)
- Removed algebraic effects module. If you want effects, just go with finally-tagless approach.
Diffstat (limited to 'stdlib/test')
-rw-r--r--stdlib/test/test/lux/control/effect.lux72
-rw-r--r--stdlib/test/tests.lux3
2 files changed, 1 insertions, 74 deletions
diff --git a/stdlib/test/test/lux/control/effect.lux b/stdlib/test/test/lux/control/effect.lux
deleted file mode 100644
index 65a7646ca..000000000
--- a/stdlib/test/test/lux/control/effect.lux
+++ /dev/null
@@ -1,72 +0,0 @@
-(;module:
- lux
- (lux [io "IO/" Monad<IO>]
- (control monad
- functor
- effect)
- (data [text]
- text/format)
- [macro]
- ["R" math/random])
- lux/test)
-
-(do-template [<effect> <op> <field>]
- [(effect: <effect>
- (<op> [Nat Text] Bool)
- (<field> Nat))]
-
- [EffA opA fieldA]
- [EffB opB fieldB]
- [EffC opC fieldC]
- )
-
-(do-template [<effect> <op> <op-test> <field> <field-value>]
- [(handler: _
- (=> <effect> [io;IO io;Monad<IO>])
- (def: (<op> size sample)
- (IO/wrap (<op-test> size (text;size sample))))
-
- (def: <field> (IO/wrap <field-value>)))]
-
- [EffA opA n.< fieldA +10]
- [EffB opB n.= fieldB +20]
- [EffC opC n.> fieldC +30]
- )
-
-(type: EffABC (|E EffA EffB EffC))
-
-(def: Functor<EffABC>
- (Functor EffABC)
- (|F Functor<EffA> Functor<EffB> Functor<EffC>))
-
-(def: Handler<EffABC,IO>
- (Handler EffABC io;IO)
- (|H io;Monad<IO>
- Handler<EffA,IO> Handler<EffB,IO> Handler<EffC,IO>))
-
-## [Tests]
-(context: "Algebraic effects"
- (with-expansions
- [<single-effect-tests> (do-template [<op> <op-size> <field> <field-value>]
- [(io;run (with-handler Handler<EffABC,IO>
- (doE Functor<EffABC>
- []
- (lift (<op> <op-size> "YOLO")))))
- (n.= <field-value> (io;run (with-handler Handler<EffABC,IO>
- (doE Functor<EffABC>
- []
- (lift <field>)))))]
-
- [opA +10 fieldA +10]
- [opB +4 fieldB +20]
- [opC +2 fieldC +30])]
- (test "Can handle effects using handlers."
- (and <single-effect-tests>
-
- (n.= +60 (io;run (with-handler Handler<EffABC,IO>
- (doE Functor<EffABC>
- [a (lift fieldA)
- b (lift fieldB)
- c (lift fieldC)]
- (wrap ($_ n.+ a b c))))))
- ))))
diff --git a/stdlib/test/tests.lux b/stdlib/test/tests.lux
index 7eff48e75..be26d43fb 100644
--- a/stdlib/test/tests.lux
+++ b/stdlib/test/tests.lux
@@ -14,8 +14,7 @@
["_;" frp]
["_;" promise]
["_;" stm])
- (control ["_;" effect]
- ["_;" exception]
+ (control ["_;" exception]
["_;" interval]
["_;" pipe]
["_;" cont]