bdcs-0.1.0: Tools for managing a content store of software packages

Copyright(c) 2016-2017 Red Hat Inc.
LicenseLGPL
Maintainerhttps://github.com/weldr
Stabilityalpha
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

BDCS.Utils.Error

Description

Functions to help with errors

Synopsis

Documentation

errorToEither :: MonadError e m => m a -> m (Either e a) Source #

Convert an error action into an Either This is essentially runExceptT generalized to MonadError

errorToMaybe :: MonadError e m => m a -> m (Maybe a) Source #

Convert an error into into nothing

mapError :: MonadError e' m => (e -> e') -> ExceptT e m a -> m a Source #

Run an ExceptT action. On error, run a supplied function to convert the error into some type that can be thrown with throwError in MonadError. On success, simply return the value of the action.