From a01687a3f0479734882eabed82bd100fc811b698 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sat, 21 Mar 2015 12:50:45 +0100 Subject: Number from the top row are accepted too --- src/Utils/Maybe.elm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Utils/Maybe.elm') 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 -- cgit v1.2.3