aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/data/maybe.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/data/maybe.lux24
1 files changed, 12 insertions, 12 deletions
diff --git a/stdlib/source/library/lux/data/maybe.lux b/stdlib/source/library/lux/data/maybe.lux
index bab93295d..a34bf2948 100644
--- a/stdlib/source/library/lux/data/maybe.lux
+++ b/stdlib/source/library/lux/data/maybe.lux
@@ -15,7 +15,7 @@
## #.None
## (#.Some a))
-(implementation: #export monoid
+(implementation: .public monoid
(All [a] (Monoid (Maybe a)))
(def: identity #.None)
@@ -28,7 +28,7 @@
(#.Some x)
(#.Some x))))
-(implementation: #export functor
+(implementation: .public functor
(Functor Maybe)
(def: (map f ma)
@@ -36,7 +36,7 @@
#.None #.None
(#.Some a) (#.Some (f a)))))
-(implementation: #export apply
+(implementation: .public apply
(Apply Maybe)
(def: &functor ..functor)
@@ -49,7 +49,7 @@
_
#.None)))
-(implementation: #export monad
+(implementation: .public monad
(Monad Maybe)
(def: &functor ..functor)
@@ -65,7 +65,7 @@
(#.Some mx)
mx)))
-(implementation: #export (equivalence super)
+(implementation: .public (equivalence super)
(All [a] (-> (Equivalence a) (Equivalence (Maybe a))))
(def: (= mx my)
@@ -79,7 +79,7 @@
_
#0)))
-(implementation: #export (hash super)
+(implementation: .public (hash super)
(All [a] (-> (Hash a) (Hash (Maybe a))))
(def: &equivalence
@@ -93,7 +93,7 @@
(#.Some value)
(\ super hash value))))
-(implementation: #export (with monad)
+(implementation: .public (with monad)
(All [M] (-> (Monad M) (Monad (All [a] (M (Maybe a))))))
(def: &functor (functor.compose (get@ #monad.&functor monad) ..functor))
@@ -110,12 +110,12 @@
(#.Some Mma)
Mma))))
-(def: #export (lift monad)
+(def: .public (lift monad)
{#.doc (doc "Wraps a monadic value with Maybe machinery.")}
(All [M a] (-> (Monad M) (-> (M a) (M (Maybe a)))))
(\ monad map (\ ..monad in)))
-(macro: #export (else tokens state)
+(macro: .public (else tokens state)
{#.doc (doc "Allows you to provide a default value that will be used"
"if a (Maybe x) value turns out to be #.None."
"Note: the expression for the default value will not be computed if the base computation succeeds."
@@ -139,14 +139,14 @@
_
(#.Left "Wrong syntax for else")))
-(def: #export assume
+(def: .public assume
{#.doc (doc "Assumes that a Maybe value is a #.Some and yields its value."
"Raises/throws a runtime error otherwise."
"WARNING: Use with caution.")}
(All [a] (-> (Maybe a) a))
(|>> (..else (undefined))))
-(def: #export (list value)
+(def: .public (list value)
(All [a] (-> (Maybe a) (List a)))
(case value
#.None
@@ -155,7 +155,7 @@
(#.Some value)
(#.Item value #.End)))
-(macro: #export (when tokens state)
+(macro: .public (when tokens state)
{#.doc (doc "Can be used as a guard in (co)monadic be/do expressions."
(do monad
[value (do_something 1 2 3)