concrete functor and monad transformers
#83Add a kind synonym: MonadTransformer = (Type -> Type) -> (Type -> Type)
-- The kind of monad transformers. When used, T :: MonadTransformer should serve as
-- an informal indicator that there is a MonadTrans T instance.
type MonadTransformer :: Type
type MonadTransformer = (Type -> Type) -> (Type -> Type)
Which appears all over the place, and simplifies a lot of messy kinds, MonadTrans
reads fairly clear here and ComposeT
(composition of monad transformers) does as well
type MonadTrans :: MonadTransformer -> Constraint
type ComposeT :: MonadTransformer -> MonadTransformer -> MonadTransformer
newtype ComposeT trans1 trans2 m a = ComposeT (trans1 (trans2 m) a)
From Elevator
and others
type Elevator :: MonadTransformer -> MonadTransformer
newtype Elevator trans m a = Elevator (trans m a)
type ReaderT :: Type -> MonadTransformer
type StateT :: Type -> MonadTransformer
type WriterT :: Type -> MonadTransformer
at very little cost (a single synonym).