diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/data/lazy.lux | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/stdlib/source/library/lux/data/lazy.lux b/stdlib/source/library/lux/data/lazy.lux index d4b345f87..1fa45e583 100644 --- a/stdlib/source/library/lux/data/lazy.lux +++ b/stdlib/source/library/lux/data/lazy.lux @@ -17,12 +17,12 @@ [type abstract]]]) -(abstract: #export (Lazy a) - (-> [] a) - +(abstract: .public (Lazy a) {#.doc (doc "A value specified by an expression that is calculated only at the last moment possible." "Afterwards, the value is cached for future reference.")} + (-> [] a) + (def: (lazy' generator) (All [a] (-> (-> [] a) (Lazy a))) (let [cache (atom.atom #.None)] @@ -36,36 +36,36 @@ (exec (io.run (atom.compare_and_swap _ (#.Some value) cache)) value))))))) - (def: #export (value lazy) + (def: .public (value lazy) (All [a] (-> (Lazy a) a)) ((:representation lazy) []))) -(syntax: #export (lazy expression) +(syntax: .public (lazy expression) {#.doc (doc "Specifies a lazy value by providing the expression that computes it.")} (with_gensyms [g!_] (in (list (` ((~! lazy') (function ((~ g!_) (~ g!_)) (~ expression)))))))) -(implementation: #export (equivalence (^open "\.")) +(implementation: .public (equivalence (^open "\.")) (All [a] (-> (Equivalence a) (Equivalence (Lazy a)))) (def: (= left right) (\= (..value left) (..value right)))) -(implementation: #export functor +(implementation: .public functor (Functor Lazy) (def: (map f fa) (lazy (f (value fa))))) -(implementation: #export apply +(implementation: .public apply (Apply Lazy) (def: &functor ..functor) (def: (apply ff fa) (lazy ((value ff) (value fa))))) -(implementation: #export monad +(implementation: .public monad (Monad Lazy) (def: &functor ..functor) |