diff options
Diffstat (limited to '')
-rw-r--r-- | source/lux/data/maybe.lux | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/source/lux/data/maybe.lux b/source/lux/data/maybe.lux index 77dbec5b1..7c0affd68 100644 --- a/source/lux/data/maybe.lux +++ b/source/lux/data/maybe.lux @@ -41,18 +41,9 @@ #;None #;None (#;Some xs) xs))) -## [Syntax] -(defmacro #export (? tokens state) - (case tokens - (\ (list maybe else)) - (let [g!value (symbol$ ["" "_"]) - g!_ (symbol$ ["" "12_34"])] - (#;Right state (list (` (case (~ maybe) - (#;Some (~ g!value)) - (~ g!value) - - (~ g!_) - (~ else)))))) - - _ - (#;Left "Wrong syntax for ?"))) +## [Functions] +(def #export (? else maybe) + (All [a] (-> a (Maybe a) a)) + (case maybe + (#;Some x) x + _ else)) |