1
Fork 0

Normalize transformer imports.

Importantly, we want our transformer "singular" type aliases to be
consistent. Therefore ban the use of the Maybe transformer (which we can
easily replaces instances of with ExceptT () instead) and the either
transformer (instead, favor use of ExceptT).
master
Joshua Potter 2017-12-12 22:16:25 -08:00
parent 86cf1df6bd
commit 1024c35452
2 changed files with 31 additions and 25 deletions

View File

@ -19,7 +19,6 @@ library
default-language: Haskell2010 default-language: Haskell2010
build-depends: base >= 4.7 && < 5, build-depends: base >= 4.7 && < 5,
bytestring == 0.10.8.1, bytestring == 0.10.8.1,
either == 4.4.1.1,
exceptions == 0.8.3, exceptions == 0.8.3,
free == 4.12.4, free == 4.12.4,
mtl == 2.2.1, mtl == 2.2.1,

View File

@ -50,37 +50,19 @@ import Control.Monad.Catch as X
) )
import Control.Monad.Except as X import Control.Monad.Except as X
-- Note runExceptT is not actually a type declaration within the ExceptT ( MonadError, catchError, throwError
-- newtype but writing as follows for consistency's sake.
( ExceptT, ExceptT(ExceptT), runExceptT
) )
import Control.Monad.Free as X import Control.Monad.Free as X
( Free, Free(Pure), Free(Free) ( MonadFree, wrap
, retract
, wrap
) )
import Control.Monad.Reader as X import Control.Monad.Reader as X
( MonadReader, ask, local, reader ( MonadReader, ask, local, reader
, Reader, runReader
, ReaderT, ReaderT(ReaderT), runReaderT
) )
import Control.Monad.State as X import Control.Monad.State as X
( MonadState, get, put, state ( MonadState, get, put, state
, State, runState
-- Note there also exists a strict interpretation but we default to the lazy
-- implementation.
, StateT, StateT(StateT), runStateT
)
import Control.Monad.Writer as X
( MonadWriter, listen, pass, tell, writer
, Writer, runWriter
-- Note there also exists a strict interpretation but we default to the lazy
-- implementation.
, WriterT, WriterT(WriterT), runWriterT
) )
import Control.Monad.Trans as X import Control.Monad.Trans as X
@ -88,12 +70,37 @@ import Control.Monad.Trans as X
, lift , lift
) )
import Control.Monad.Trans.Either as X import Control.Monad.Writer as X
( EitherT, EitherT(EitherT), runEitherT ( MonadWriter, listen, pass, tell, writer
) )
import Control.Monad.Trans.Maybe as X import Control.Monad.Trans.Except as X
( MaybeT, MaybeT(MaybeT), runMaybeT ( Except -- ^ ExceptT e Identity :: * -> *
, ExceptT, ExceptT(ExceptT)
, runExceptT
)
import Control.Monad.Trans.Free as X
( Free -- ^ FreeT f Identity :: * -> *
, FreeF, FreeF(Pure), FreeF(Free)
, FreeT, FreeT(FreeT), runFreeT
)
import Control.Monad.Trans.Reader as X
( Reader -- ^ ReaderT r Identity :: * -> *
, ReaderT, ReaderT(ReaderT), runReaderT
)
-- We default to the lazy implementation of State.
import Control.Monad.Trans.State as X
( State -- ^ StateT s Identity :: * -> *
, StateT, StateT(StateT), runStateT
)
-- We default to the lazy implementation of Writer.
import Control.Monad.Trans.Writer as X
( Writer -- ^ WriterT w Identity :: * -> *
, WriterT, WriterT(WriterT), runWriterT
) )
import Data.Bool as X import Data.Bool as X