From 378ec9dd704995255cf3983449421e22a62756c4 Mon Sep 17 00:00:00 2001 From: Renzo Carbonara Date: Fri, 14 Mar 2014 17:33:59 -0300 Subject: [PATCH] Export Control.Error.Util.(?:) and fix compiler warnings --- Control/Error/Util.hs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Control/Error/Util.hs b/Control/Error/Util.hs index 8f8da88..2055585 100644 --- a/Control/Error/Util.hs +++ b/Control/Error/Util.hs @@ -13,6 +13,9 @@ module Control.Error.Util ( failWith, failWithM, + -- * Maybe + (?:), + -- * MaybeT maybeT, just, @@ -34,7 +37,7 @@ module Control.Error.Util ( -- * Exceptions tryIO, - syncIO + syncIO ) where import Control.Applicative (Applicative, pure, (<$>)) @@ -49,9 +52,6 @@ import Data.Maybe (fromMaybe) import System.Exit (ExitCode) import System.IO (hPutStr, hPutStrLn, stderr) --- For Documentation -import Data.EitherR (fmapL, fmapLT) - {- $conversion Use these functions to convert between 'Maybe', 'Either', 'MaybeT', and 'EitherT'. @@ -129,7 +129,9 @@ isLeft = either (const True) (const False) isRight :: Either a b -> Bool isRight = either (const False) (const True) --- | 'fmap' specialized to 'Either', given a name symmetric to 'fmapL' +{- | 'fmap' specialized to 'Either', given a name symmetric to + 'Data.EitherR.fmapL' +-} fmapR :: (a -> b) -> Either l a -> Either l b fmapR = fmap @@ -159,7 +161,9 @@ instance (Monoid e, Monoid r) => Monoid (AnyE e r) where mappend (AnyE (Left _)) (AnyE (Right y)) = AnyE (Right y) mappend (AnyE (Left x)) (AnyE (Left y)) = AnyE (Left (mappend x y)) --- | 'fmap' specialized to 'EitherT', given a name symmetric to 'fmapLT' +{- | 'fmap' specialized to 'EitherT', given a name symmetric to + 'Data.EitherR.fmapLT' +-} fmapRT :: (Monad m) => (a -> b) -> EitherT l m a -> EitherT l m b fmapRT = liftM