module BinaryParser.Prelude
(
module Exports,
mapLeft,
joinMap,
)
where
import BasePrelude as Exports hiding (fail)
import Control.Monad.Trans.State.Strict as Exports hiding (liftCallCC, liftCatch)
import Control.Monad.Trans.Reader as Exports hiding (liftCallCC, liftCatch)
import Control.Monad.Trans.Class as Exports
import Data.ByteString as Exports (ByteString)
import Data.Text as Exports (Text)
mapLeft :: (a -> b) -> Either a x -> Either b x
mapLeft f =
either (Left . f) Right
joinMap :: Monad m => (a -> m b) -> m a -> m b
joinMap f =
join . liftM f