mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-11 05:25:28 +03:00
core: implement zero for Maybe and Result
This commit is contained in:
parent
87fe06bfbc
commit
918c893189
@ -66,4 +66,7 @@ It is the inverse of [`just?`](#just?).")
|
||||
(if (null? a)
|
||||
(Nothing)
|
||||
(Just @(Pointer.to-ref a))))
|
||||
|
||||
(doc zero "returns `Nothing`.")
|
||||
(defn zero [] (Nothing))
|
||||
)
|
||||
|
@ -106,6 +106,9 @@ It is the inverse of [`success?`](#success?).")
|
||||
(match @b
|
||||
(Success _) false
|
||||
(Error y) (= x y))))
|
||||
|
||||
(doc zero "returns `(Success (zero))`.")
|
||||
(defn zero [] (Success (zero)))
|
||||
)
|
||||
|
||||
(defmodule Maybe
|
||||
|
Loading…
Reference in New Issue
Block a user