diff options
author | Joris Guyonvarch | 2015-03-21 12:50:45 +0100 |
---|---|---|
committer | Joris Guyonvarch | 2015-03-21 12:50:45 +0100 |
commit | a01687a3f0479734882eabed82bd100fc811b698 (patch) | |
tree | 7d764652bb57bb8983cf737fb3ab8ec6a9f59ec1 /src/Utils/Maybe.elm | |
parent | 29eac851219e36bccf2724b05d52b70438b5bf3f (diff) |
Number from the top row are accepted too
Diffstat (limited to 'src/Utils/Maybe.elm')
-rw-r--r-- | src/Utils/Maybe.elm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Utils/Maybe.elm b/src/Utils/Maybe.elm index 25d02e7..355ded9 100644 --- a/src/Utils/Maybe.elm +++ b/src/Utils/Maybe.elm @@ -1,5 +1,6 @@ module Utils.Maybe ( filterMaybe + , orElse ) where filterMaybe : (a -> Bool) -> Maybe a -> Maybe a @@ -11,3 +12,9 @@ filterMaybe cond maybe = else Nothing Nothing -> Nothing + +orElse : Maybe a -> Maybe a -> Maybe a +orElse mb1 mb2 = + case mb1 of + Just x -> Just x + Nothing -> mb2 |