aboutsummaryrefslogtreecommitdiffstats
path: root/stdlib/maybe-with-unions.lisp
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2022-12-05 14:19:12 +0200
committerJan Tuomi <jans.tuomi@gmail.com>2022-12-05 14:21:53 +0200
commit4002b8988c799a904ef1f359d4267ef4ad80cba3 (patch)
treedbb67560f3a44c57df4b0e960861f60605ceb45f /stdlib/maybe-with-unions.lisp
parentbba047ae945ae7d7899d6e2c1610923bcedb0442 (diff)
Rename project to Milch
Diffstat (limited to 'stdlib/maybe-with-unions.lisp')
-rw-r--r--stdlib/maybe-with-unions.lisp42
1 files changed, 0 insertions, 42 deletions
diff --git a/stdlib/maybe-with-unions.lisp b/stdlib/maybe-with-unions.lisp
deleted file mode 100644
index 53a5024..0000000
--- a/stdlib/maybe-with-unions.lisp
+++ /dev/null
@@ -1,42 +0,0 @@
-; LIB
-
-(union! Maybe
- (just value)
- (nothing))
-
-(let! Maybe/map (\[f m]
- (match (kind m)
- "Maybe/Just" (Maybe/just (f (Maybe/Just/get-value m)))
- "Maybe/Nothing" (Maybe/nothing))))
-
-(let! Maybe/and-then (\[f m]
- (match (kind m)
- "Maybe/Just" (f (Maybe/Just/get-value m))
- "Maybe/Nothing" (Maybe/nothing))))
-
-; TESTING
-
-;; (let! print-line! (\[s]
-;; (print! (concat s "\n"))))
-
-;; (let! a (Maybe/just 10))
-;; (let! b (Maybe/nothing))
-
-;; (Maybe/map (+ 5) a)
-;; (Maybe/map (+ 5) b)
-
-;; (Maybe/and-then (\[n] (Maybe/just (+ n 5))) a)
-;; (Maybe/and-then (\[n] (Maybe/just (+ n 5))) b)
-
-;; (let! m (Maybe/just 10))
-;; (match m
-;; (Maybe/just _)
-;; (print-line! (fmt "found just {0}!" [(Maybe/Just/get-value m)]))
-;; (Maybe/nothing)
-;; (print-line! "found nothing!"))
-
-;; (let! m (Maybe/just 10))
-;; (pipe m [
-;; (Maybe/map (+ 5))
-;; (Maybe/and-then (\[val] (Maybe/just (- val 3))))
-;; ])