module Prolude.Maybe
  ( module Data.Maybe
  , note
  , hush
  )
where

import Data.Maybe
    ( Maybe(Just, Nothing)
    , catMaybes
    , fromMaybe
    , isJust
    , isNothing
    , listToMaybe
    , mapMaybe
    , maybe
    , maybeToList
    )

{-# INLINE hush #-}
-- | Suppress the 'Left' value of an 'Either'
hush :: Either a b -> Maybe b
hush :: forall a b. Either a b -> Maybe b
hush = forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either (forall a b. a -> b -> a
const forall a. Maybe a
Nothing) forall a. a -> Maybe a
Just

{-# INLINE note #-}
-- | Tag the 'Nothing' value of a 'Maybe'
note :: a -> Maybe b -> Either a b
note :: forall a b. a -> Maybe b -> Either a b
note a
a = forall b a. b -> (a -> b) -> Maybe a -> b
maybe (forall a b. a -> Either a b
Left a
a) forall a b. b -> Either a b
Right