diff options
Diffstat (limited to 'stdlib/source/library/lux/control/continuation.lux')
-rw-r--r-- | stdlib/source/library/lux/control/continuation.lux | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/stdlib/source/library/lux/control/continuation.lux b/stdlib/source/library/lux/control/continuation.lux index 16f789010..ef0392fe9 100644 --- a/stdlib/source/library/lux/control/continuation.lux +++ b/stdlib/source/library/lux/control/continuation.lux @@ -13,21 +13,21 @@ [syntax (#+ syntax:)] ["." code]]]]) -(type: #export (Cont i o) +(type: .public (Cont i o) {#.doc "Continuations."} (-> (-> i o) o)) -(def: #export (continue next cont) +(def: .public (continue next cont) {#.doc "Continues a continuation thunk."} (All [i o] (-> (-> i o) (Cont i o) o)) (cont next)) -(def: #export (run cont) +(def: .public (run cont) {#.doc "Forces a continuation thunk to be evaluated."} (All [a] (-> (Cont a a) a)) (cont function.identity)) -(def: #export (call/cc f) +(def: .public (call/cc f) {#.doc "Call with current continuation."} (All [a b z] (-> (-> (-> a (Cont b z)) @@ -37,18 +37,18 @@ (f (function (_ a) (function (_ _) (k a))) k))) -(syntax: #export (pending expr) +(syntax: .public (pending expr) {#.doc (doc "Turns any expression into a function that is pending a continuation." (pending (some_function some_input)))} (with_gensyms [g!_ g!k] (in (list (` (.function ((~ g!_) (~ g!k)) ((~ g!k) (~ expr)))))))) -(def: #export (reset scope) +(def: .public (reset scope) (All [i o] (-> (Cont i i) (Cont i o))) (function (_ k) (k (run scope)))) -(def: #export (shift f) +(def: .public (shift f) (All [a] (-> (-> (-> a (Cont a a)) (Cont a a)) @@ -57,13 +57,13 @@ (f (function (_ a) (function (_ ic) (ic (oc a)))) function.identity))) -(implementation: #export functor +(implementation: .public functor (All [o] (Functor (All [i] (Cont i o)))) (def: (map f fv) (function (_ k) (fv (function.compose k f))))) -(implementation: #export apply +(implementation: .public apply (All [o] (Apply (All [i] (Cont i o)))) (def: &functor ..functor) @@ -74,7 +74,7 @@ (function (_ v)) fv (function (_ f)) ff)))) -(implementation: #export monad +(implementation: .public monad (All [o] (Monad (All [i] (Cont i o)))) (def: &functor ..functor) @@ -86,7 +86,7 @@ (function (_ k) (ffa (continue k))))) -(def: #export (portal init) +(def: .public (portal init) (All [i o z] (-> i (Cont [(-> i (Cont o z)) |