module Data.Maybe.Extended (
  module Data.Maybe,
  nothingIf
  ) where

import Data.Maybe

nothingIf :: (a -> Bool) -> a -> Maybe a
nothingIf :: forall a. (a -> Bool) -> a -> Maybe a
nothingIf a -> Bool
p a
x = if a -> Bool
p a
x then forall a. Maybe a
Nothing else forall a. a -> Maybe a
Just a
x