aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/data/sum.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/data/sum.lux12
1 files changed, 7 insertions, 5 deletions
diff --git a/stdlib/source/lux/data/sum.lux b/stdlib/source/lux/data/sum.lux
index 716b3908a..ade411e6b 100644
--- a/stdlib/source/lux/data/sum.lux
+++ b/stdlib/source/lux/data/sum.lux
@@ -10,11 +10,13 @@
[left a +0]
[right b +1])
-(def: #export (either f g s)
- (All [a b c] (-> (-> a c) (-> b c) (| a b) c))
- (case s
- (+0 x) (f x)
- (+1 x) (g x)))
+(def: #export (either f g)
+ (All [a b c] (-> (-> a c) (-> b c)
+ (-> (| a b) c)))
+ (lambda [input]
+ (case input
+ (+0 l) (f l)
+ (+1 r) (g r))))
(do-template [<name> <side> <tag>]
[(def: #export (<name> es)