aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux.lux9
1 files changed, 8 insertions, 1 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux
index 334632272..1a35b4ebd 100644
--- a/stdlib/source/lux.lux
+++ b/stdlib/source/lux.lux
@@ -1574,6 +1574,13 @@
(form$ (list op a1 a2))}
op))
+(def:''' (function/flip func)
+ #Nil
+ (All [a b c]
+ (-> (-> a b c) (-> b a c)))
+ (function' [right left]
+ (func left right)))
+
(macro:' #export (_$ tokens)
(#Cons [(tag$ ["lux" "doc"])
(text$ ("lux text concat"
@@ -1586,7 +1593,7 @@
#Nil)
({(#Cons op tokens')
({(#Cons first nexts)
- (return (list (list/fold (_$_joiner op) first nexts)))
+ (return (list (list/fold (function/flip (_$_joiner op)) first nexts)))
_
(fail "Wrong syntax for _$")}