aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/control/continuation.lux
blob: 4279293dee2604e10ca76ba9e4042dcf20afd659 (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
(.require
 [library
  [lux (.except if loop)
   ["$" documentation]
   [data
    [text (.only \n)
     ["%" \\format (.only format)]]]]]
 [\\library
  ["[0]" /]])

(.def .public documentation
  (.List $.Module)
  ($.module /._
            ""
            [($.definition /.reset)
             ($.definition /.shift)
             ($.definition /.functor)
             ($.definition /.apply)
             ($.definition /.monad)
             ($.definition /.portal)

             ($.definition (/.Cont input output)
               "Continuations.")

             ($.definition /.continued
               "Continues a continuation thunk."
               [(continued next cont)])

             ($.definition /.result
               "Forces a continuation thunk to be evaluated."
               [(result cont)])

             ($.definition /.with_current
               "Call with current continuation."
               [(with_current
                  (function (_ go)
                    (do /.monad
                      [.let [nexus (function (nexus val)
                                     (go [nexus val]))]
                       _ (go [nexus init])]
                      (in (undefined)))))])

             ($.definition /.pending
               "Turns any expression into a function that is pending a continuation."
               [(pending (some_function some_input))])]
            []))