aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/control/function/mixin.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/control/function/mixin.lux9
1 files changed, 0 insertions, 9 deletions
diff --git a/stdlib/source/library/lux/control/function/mixin.lux b/stdlib/source/library/lux/control/function/mixin.lux
index cdaa35a6c..98009b21d 100644
--- a/stdlib/source/library/lux/control/function/mixin.lux
+++ b/stdlib/source/library/lux/control/function/mixin.lux
@@ -10,23 +10,19 @@
[monad (#+ Monad do)]]]])
(type: .public (Mixin i o)
- {#.doc (example "A function which can be mixed with others to inherit their behavior.")}
(-> (-> i o) (-> i o) (-> i o)))
(def: .public (mixin f)
- {#.doc (example "Given a mixin, produces a normal function.")}
(All [i o] (-> (Mixin i o) (-> i o)))
(function (mix input)
((f mix mix) input)))
(def: .public nothing
- {#.doc (example "A mixin that does nothing and just delegates work to the next mixin.")}
Mixin
(function (_ delegate recur)
delegate))
(def: .public (with parent child)
- {#.doc (example "Produces a new mixin, where the behavior of the child can make use of the behavior of the parent.")}
(All [i o] (-> (Mixin i o) (Mixin i o) (Mixin i o)))
(function (_ delegate recur)
(parent (child delegate recur) recur)))
@@ -38,7 +34,6 @@
(def: compose ..with))
(def: .public (advice when then)
- {#.doc (example "Only apply then mixin when the input meets some criterion.")}
(All [i o] (-> (Predicate i) (Mixin i o) (Mixin i o)))
(function (_ delegate recur input)
(if (when input)
@@ -46,7 +41,6 @@
(delegate input))))
(def: .public (before monad action)
- {#.doc (example "Executes an action before doing the main work.")}
(All [! i o] (-> (Monad !) (-> i (! Any)) (Mixin i (! o))))
(function (_ delegate recur input)
(do monad
@@ -54,7 +48,6 @@
(delegate input))))
(def: .public (after monad action)
- {#.doc (example "Executes an action after doing the main work.")}
(All [! i o] (-> (Monad !) (-> i o (! Any)) (Mixin i (! o))))
(function (_ delegate recur input)
(do monad
@@ -63,11 +56,9 @@
(in output))))
(type: .public (Recursive i o)
- {#.doc (example "An indirectly recursive function.")}
(-> (-> i o) (-> i o)))
(def: .public (of_recursive recursive)
- {#.doc (example "Transform an indirectly recursive function into a mixin.")}
(All [i o] (-> (Recursive i o) (Mixin i o)))
(function (_ delegate recur)
(recursive recur)))