aboutsummaryrefslogtreecommitdiff
path: root/src/Utils/Maybe.elm
blob: 25d02e79a7f41b51d5c215969a8b1fc5b5df47cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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