From 2613aeeae0f4de44842ff0e796603d0316a61a14 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Wed, 18 Mar 2015 00:32:17 +0100 Subject: Can edit the time, unfortunately the enter key is overriden so the '+' key of the numpad is used instead --- src/Utils/Maybe.elm | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/Utils/Maybe.elm (limited to 'src/Utils/Maybe.elm') diff --git a/src/Utils/Maybe.elm b/src/Utils/Maybe.elm new file mode 100644 index 0000000..25d02e7 --- /dev/null +++ b/src/Utils/Maybe.elm @@ -0,0 +1,13 @@ +module Utils.Maybe + ( filterMaybe + ) where + +filterMaybe : (a -> Bool) -> Maybe a -> Maybe a +filterMaybe cond maybe = + case maybe of + Just x -> + if cond x + then Just x + else Nothing + Nothing -> + Nothing -- cgit v1.2.3