aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/control/function/mixin.lux
blob: 4f7e45fed4d77a58eadab661744f2aad692ebf1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
(.require
 [library
  [lux (.except)
   ["$" documentation]
   [data
    [text (.only \n)
     ["%" \\format (.only format)]]]]]
 [\\library
  ["[0]" /]])

(def .public documentation
  (.List $.Documentation)
  (list ($.module /._
                  "")

        ($.definition /.monoid)

        ($.definition (/.Mixin input output)
          "A partially-defined function which can be mixed with others to inherit their behavior.")

        ($.definition /.fixed
          "Given a mixin, produces a normal function."
          ($.example (fixed f)))

        ($.definition /.nothing
          "A mixin that does nothing and just delegates work to the next mixin.")

        ($.definition /.mixed
          "Produces a new mixin, where the behavior of the child can make use of the behavior of the parent."
          ($.example (mixed parent child)))

        ($.definition /.advice
          "Only apply then mixin when the input meets some criterion."
          ($.example (advice when then)))

        ($.definition /.before
          "Executes an action before doing the main work."
          ($.example (before monad action)))

        ($.definition /.after
          "Executes an action after doing the main work."
          ($.example (after monad action)))

        ($.definition (/.Recursive input output)
          "An indirectly recursive function.")

        ($.definition /.of_recursive
          "Transform an indirectly recursive function into a mixin."
          ($.example (of_recursive recursive)))
        ))