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

(.def .public documentation
  (.List $.Documentation)
  (list ($.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))])
        ))