prologue-3.2.6: Better, more general Prelude exporting common utilities.

Safe HaskellNone
LanguageHaskell2010

Prologue.Control.Error

Synopsis

Documentation

unsafeTail :: [a] -> [a] Source #

unsafeInit :: [a] -> [a] Source #

unsafeHead :: [a] -> a Source #

unsafeLast :: [a] -> a Source #

unsafeFoldr1 :: (a -> a -> a) -> [a] -> a Source #

unsafeFoldl1 :: (a -> a -> a) -> [a] -> a Source #

unsafeFoldl1' :: (a -> a -> a) -> [a] -> a Source #

unsafeRead :: forall a. Read a => String -> a Source #

tail :: MonadPlus m => [a] -> m [a] Source #

init :: MonadPlus m => [a] -> m [a] Source #

head :: MonadPlus m => [a] -> m a Source #

last :: MonadPlus m => [a] -> m a Source #

foldr1 :: MonadPlus m => (a -> a -> a) -> [a] -> m a Source #

foldl1 :: MonadPlus m => (a -> a -> a) -> [a] -> m a Source #

foldl1' :: MonadPlus m => (a -> a -> a) -> [a] -> m a Source #

read :: MonadPlus m => Read a => String -> m a Source #

takeExactly :: MonadPlus m => Int -> [a] -> m [a] Source #

dropExactly :: MonadPlus m => Int -> [a] -> m [a] Source #

splitAtExactly :: MonadPlus m => Int -> [a] -> m ([a], [a]) Source #

splitHead :: [a] -> (Maybe a, [a]) Source #

hoistMaybe :: MonadPlus m => Maybe a -> m a Source #

tryRight :: Monad m => Either e a -> ExceptT e m a #

A fromRight that fails in the ExceptT monad

tryJust :: Monad m => e -> Maybe a -> ExceptT e m a #

A fromJust that fails in the ExceptT monad

tryAssert :: Monad m => e -> Bool -> ExceptT e m () #

An assertion that fails in the ExceptT monad

tryRead :: (Monad m, Read a) => e -> String -> ExceptT e m a #

A read that fails in the ExceptT monad

tryFoldl1' :: Monad m => e -> (a -> a -> a) -> [a] -> ExceptT e m a #

A foldl1' that fails in the ExceptT monad

tryFoldl1 :: Monad m => e -> (a -> a -> a) -> [a] -> ExceptT e m a #

A foldl1 that fails in the ExceptT monad

tryFoldr1 :: Monad m => e -> (a -> a -> a) -> [a] -> ExceptT e m a #

A foldr1 that fails in the ExceptT monad

tryMaximum :: (Monad m, Ord a) => e -> [a] -> ExceptT e m a #

A maximum that fails in the ExceptT monad

tryMinimum :: (Monad m, Ord a) => e -> [a] -> ExceptT e m a #

A minimum that fails in the ExceptT monad

tryLast :: Monad m => e -> [a] -> ExceptT e m a #

A last that fails in the ExceptT monad

tryHead :: Monad m => e -> [a] -> ExceptT e m a #

A head that fails in the ExceptT monad

tryInit :: Monad m => e -> [a] -> ExceptT e m [a] #

An init that fails in the ExceptT monad

tryTail :: Monad m => e -> [a] -> ExceptT e m [a] #

A tail that fails in the ExceptT monad

justErr :: e -> Maybe a -> Either e a #

A fromJust that fails in the Either monad

assertErr :: e -> Bool -> Either e () #

An assertion that fails in the Either monad

readErr :: Read a => e -> String -> Either e a #

A read that fails in the Either monad

foldl1Err' :: e -> (a -> a -> a) -> [a] -> Either e a #

A foldl1' that fails in the Either monad

foldl1Err :: e -> (a -> a -> a) -> [a] -> Either e a #

A foldl1 that fails in the Either monad

foldr1Err :: e -> (a -> a -> a) -> [a] -> Either e a #

A foldr1 that fails in the Either monad

maximumErr :: Ord a => e -> [a] -> Either e a #

A maximum that fails in the Either monad

minimumErr :: Ord a => e -> [a] -> Either e a #

A minimum that fails in the Either monad

lastErr :: e -> [a] -> Either e a #

A last that fails in the Either monad

headErr :: e -> [a] -> Either e a #

A head that fails in the Either monad

initErr :: e -> [a] -> Either e [a] #

An init that fails in the Either monad

tailErr :: e -> [a] -> Either e [a] #

A tail that fails in the Either monad

isRightT :: Monad m => ExceptT a m b -> m Bool #

Analogous to isRight, but for ExceptT

isLeftT :: Monad m => ExceptT a m b -> m Bool #

Analogous to isLeft, but for ExceptT

isNothingT :: Monad m => MaybeT m a -> m Bool #

Analogous to isNothing, but for MaybeT

isJustT :: Monad m => MaybeT m a -> m Bool #

Analogous to isJust, but for MaybeT

nothing :: Monad m => MaybeT m a #

Analogous to Nothing and equivalent to mzero

just :: Monad m => a -> MaybeT m a #

Analogous to Just and equivalent to return

noteT :: Monad m => a -> MaybeT m b -> ExceptT a m b #

Tag the Nothing value of a MaybeT

note :: a -> Maybe b -> Either a b #

Tag the Nothing value of a Maybe

hushT :: Monad m => ExceptT a m b -> MaybeT m b #

Suppress the Left value of an ExceptT

hush :: Either a b -> Maybe b #

Suppress the Left value of an Either