aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/control/function.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/control/function.lux')
-rw-r--r--stdlib/source/library/lux/control/function.lux28
1 files changed, 14 insertions, 14 deletions
diff --git a/stdlib/source/library/lux/control/function.lux b/stdlib/source/library/lux/control/function.lux
index 3e0669133..2f31e896a 100644
--- a/stdlib/source/library/lux/control/function.lux
+++ b/stdlib/source/library/lux/control/function.lux
@@ -5,38 +5,38 @@
[monoid (#+ Monoid)]]]])
(def: .public identity
- {#.doc (doc "Identity function."
- "Does nothing to its argument and just returns it."
- (is? (identity value)
- value))}
+ {#.doc (example "Identity function."
+ "Does nothing to its argument and just returns it."
+ (is? (identity value)
+ value))}
(All [a] (-> a a))
(|>>))
(def: .public (compose f g)
- {#.doc (doc "Function composition."
- (= ((compose f g) "foo")
- (f (g "foo"))))}
+ {#.doc (example "Function composition."
+ (= ((compose f g) "foo")
+ (f (g "foo"))))}
(All [a b c]
(-> (-> b c) (-> a b) (-> a c)))
(|>> g f))
(def: .public (constant value)
- {#.doc (doc "Create constant functions."
- (= ((constant "foo") "bar")
- "foo"))}
+ {#.doc (example "Create constant functions."
+ (= ((constant "foo") "bar")
+ "foo"))}
(All [o] (-> o (All [i] (-> i o))))
(function (_ _) value))
(def: .public (flip f)
- {#.doc (doc "Flips the order of the arguments of a function."
- (= ((flip f) "foo" "bar")
- (f "bar" "foo")))}
+ {#.doc (example "Flips the order of the arguments of a function."
+ (= ((flip f) "foo" "bar")
+ (f "bar" "foo")))}
(All [a b c]
(-> (-> a b c) (-> b a c)))
(function (_ x y) (f y x)))
(def: .public (apply input function)
- {#.doc (doc "Simple 1-argument function application.")}
+ {#.doc (example "Simple 1-argument function application.")}
(All [i o]
(-> i (-> i o) o))
(function input))