Module

Control.Error.Util

Package
purescript-errors
Repository
passy/purescript-errors

Use these functions to convert between Maybe, Either, MaybeT, and ExceptT.

#hush Source

hush :: forall b a. Either a b -> Maybe b

Suppress the Left value of an Either

#hushT Source

hushT :: forall m b a. Monad m => ExceptT a m b -> MaybeT m b

Suppress the Left value of an ExceptT

#note Source

note :: forall b a. a -> Maybe b -> Either a b

Tag the Nothing value of a Maybe

#noteT Source

noteT :: forall m b a. Monad m => a -> MaybeT m b -> ExceptT a m b

Tag the Nothing value of a MaybeT

#hoistMaybe Source

hoistMaybe :: forall m b. Monad m => Maybe b -> MaybeT m b

Lift a Maybe to the MaybeT monad

#(??) Source

Operator alias for Control.Error.Util.exceptNoteM (left-associative / precedence 9)

#(!?) Source

Operator alias for Control.Error.Util.exceptNoteA (left-associative / precedence 9)

#(?:) Source

Operator alias for Control.Error.Util.fromMaybe' (left-associative / precedence 9)

#fromMaybe' Source

fromMaybe' :: forall a. Maybe a -> a -> a

An infix form of fromMaybe with arguments flipped.

#exceptNoteA Source

exceptNoteA :: forall m e a. Apply m => m (Maybe a) -> e -> ExceptT e m a

Convert an applicative Maybe value into the ExceptT monad

#exceptNoteM Source

exceptNoteM :: forall m e a. Applicative m => Maybe a -> e -> ExceptT e m a

Convert a Maybe value into the ExceptT monad

#bool Source

bool :: forall a. a -> a -> Boolean -> a

Case analysis for the Boolean type