Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides
Template Haskell based derivers for typical newtype instances,
which the GeneralizedNewtypeDeriving
extension refuses to handle.
Here is what it allows you to do:
{-# LANGUAGE UndecidableInstances, TypeFamilies, FlexibleInstances, TemplateHaskell, GeneralizedNewtypeDeriving, MultiParamTypeClasses #-} import NewtypeDeriving import Control.Monad.Base import Control.Monad.Trans.Control import Control.Monad.Trans.Class import Control.Monad.Trans.Either import Control.Monad.Trans.Maybe import Control.Monad.Trans.State import Control.Monad.Trans.Reader import Control.Monad.Trans.Writer newtype T m a = T (ReaderT Int (StateT Char (WriterT [Int] (EitherT String (MaybeT m)))) a) deriving (Functor, Applicative, Monad) monadTransInstance ''T monadTransControlInstance ''T monadBaseTransformerInstance ''T monadBaseControlTransformerInstance ''T
- monadTransInstance :: Name -> Q [Dec]
- monadBaseTransformerInstance :: Name -> Q [Dec]
- monadTransControlInstance :: Name -> Q [Dec]
- monadBaseControlTransformerInstance :: Name -> Q [Dec]
Documentation
monadTransInstance :: Name -> Q [Dec] Source
Given a name of a newtype wrapper
produce an instance of
Control.Monad.Trans.Class.
.MonadTrans
monadBaseTransformerInstance :: Name -> Q [Dec] Source
Given a name of a newtype wrapper
produce an instance of
Control.Monad.Base.
,
which is specialised for monad transformers.MonadBase
monadTransControlInstance :: Name -> Q [Dec] Source
Given a name of a newtype wrapper
produce an instance of
Control.Monad.Trans.Control.
.MonadTransControl
monadBaseControlTransformerInstance :: Name -> Q [Dec] Source
Given a name of a newtype wrapper
produce an instance of
Control.Monad.Trans.Control.
,
which is specialised for monad transformers.MonadBaseControl