diff --git a/share/wake/lib/core/syntax.wake b/share/wake/lib/core/syntax.wake index 4f09c38e0..4836b7c17 100644 --- a/share/wake/lib/core/syntax.wake +++ b/share/wake/lib/core/syntax.wake @@ -37,6 +37,11 @@ export def (dollarFn: a => b) $ (argument: a): b = export def (f: b => c) ∘ (g: a => b): a => c = \x f (g x) +# Function composition. +# (compose f g) x = f (g x) +export def compose (f: b => c) (g: a => b): a => c = + \x f (g x) + # Allows flipping the parameters of a function. # icmp.flip 4 5 = GT # icmp.flip 5 4 = LT