bdcs-0.2.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.Either

Description

Utility functions to help with Either values

Synopsis

Documentation

maybeToEither :: MonadError e m => e -> Maybe a -> m a Source #

Throw the passed err if the value is Nothing, otherwise return the value.

whenLeft :: Monad m => Either e a -> (e -> m ()) -> m () Source #

Run a function on the Left error, otherwise do nothing

whenRight :: Monad m => Either e a -> (a -> m ()) -> m () Source #

Run a function on the Right value, otherwise do nothing