ghc-6.12.1: The GHC APISource codeContentsIndex
DsMonad
Synopsis
type DsM result = TcRnIf DsGblEnv DsLclEnv result
mapM :: Monad m => (a -> m b) -> [a] -> m [b]
mapAndUnzipM :: Monad m => (a -> m (b, c)) -> [a] -> m ([b], [c])
initDs :: HscEnv -> Module -> GlobalRdrEnv -> TypeEnv -> DsM a -> IO (Messages, Maybe a)
initDsTc :: DsM a -> TcM a
fixDs :: (a -> DsM a) -> DsM a
foldlM :: Monad m => (a -> b -> m a) -> a -> [b] -> m a
foldrM :: Monad m => (b -> a -> m a) -> a -> [b] -> m a
ifOptM :: DynFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()
class Functor f => Applicative f where
pure :: a -> f a
(<*>) :: f (a -> b) -> f a -> f b
(*>) :: f a -> f b -> f b
(<*) :: f a -> f b -> f a
(<$>) :: Functor f => (a -> b) -> f a -> f b
newLocalName :: Name -> TcRnIf gbl lcl Name
duplicateLocalDs :: Id -> DsM Id
newSysLocalDs :: Type -> DsM Id
newSysLocalsDs :: [Type] -> DsM [Id]
newUniqueId :: Name -> Type -> DsM Id
newFailLocalDs :: Type -> DsM Id
newPredVarDs :: PredType -> DsM Var
getSrcSpanDs :: DsM SrcSpan
putSrcSpanDs :: SrcSpan -> DsM a -> DsM a
getModuleDs :: DsM Module
newUnique :: TcRnIf gbl lcl Unique
data UniqSupply
newUniqueSupply :: TcRnIf gbl lcl UniqSupply
getDOptsDs :: DsM DynFlags
getGhcModeDs :: DsM GhcMode
doptDs :: DynFlag -> TcRnIf gbl lcl Bool
dsLookupGlobal :: Name -> DsM TyThing
dsLookupGlobalId :: Name -> DsM Id
dsLookupTyCon :: Name -> DsM TyCon
dsLookupDataCon :: Name -> DsM DataCon
dsLookupClass :: Name -> DsM Class
type DsMetaEnv = NameEnv DsMetaVal
data DsMetaVal
= Bound Id
| Splice (HsExpr Id)
dsLookupMetaEnv :: Name -> DsM (Maybe DsMetaVal)
dsExtendMetaEnv :: DsMetaEnv -> DsM a -> DsM a
type DsWarning = (SrcSpan, SDoc)
warnDs :: SDoc -> DsM ()
failWithDs :: SDoc -> DsM a
data DsMatchContext
= DsMatchContext (HsMatchContext Name) SrcSpan
| NoMatchContext
data EquationInfo = EqnInfo {
eqn_pats :: [Pat Id]
eqn_rhs :: MatchResult
}
data MatchResult = MatchResult CanItFail (CoreExpr -> DsM CoreExpr)
type DsWrapper = CoreExpr -> CoreExpr
idDsWrapper :: DsWrapper
data CanItFail
= CanFail
| CantFail
orFail :: CanItFail -> CanItFail -> CanItFail
Documentation
type DsM result = TcRnIf DsGblEnv DsLclEnv resultSource
mapM :: Monad m => (a -> m b) -> [a] -> m [b]Source
mapM f is equivalent to sequence . map f.
mapAndUnzipM :: Monad m => (a -> m (b, c)) -> [a] -> m ([b], [c])Source
The mapAndUnzipM function maps its first argument over a list, returning the result as a pair of lists. This function is mainly used with complicated data structures or a state-transforming monad.
initDs :: HscEnv -> Module -> GlobalRdrEnv -> TypeEnv -> DsM a -> IO (Messages, Maybe a)Source
initDsTc :: DsM a -> TcM aSource
fixDs :: (a -> DsM a) -> DsM aSource
foldlM :: Monad m => (a -> b -> m a) -> a -> [b] -> m aSource
Monadic version of foldl
foldrM :: Monad m => (b -> a -> m a) -> a -> [b] -> m aSource
Monadic version of foldr
ifOptM :: DynFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()Source
Do it flag is true
class Functor f => Applicative f whereSource

A functor with application.

Instances should satisfy the following laws:

identity
pure id <*> v = v
composition
pure (.) <*> u <*> v <*> w = u <*> (v <*> w)
homomorphism
pure f <*> pure x = pure (f x)
interchange
u <*> pure y = pure ($ y) <*> u
ignore left value
u *> v = pure (const id) <*> u <*> v
ignore right value
u <* v = pure const <*> u <*> v

The Functor instance should satisfy

fmap f x = pure f <*> x

If f is also a Monad, define pure = return and (<*>) = ap.

Minimal complete definition: pure and <*>.

Methods
pure :: a -> f aSource
Lift a value.
(<*>) :: f (a -> b) -> f a -> f bSource
Sequential application.
(*>) :: f a -> f b -> f bSource
Sequence actions, discarding the value of the first argument.
(<*) :: f a -> f b -> f aSource
Sequence actions, discarding the value of the second argument.
show/hide Instances
(<$>) :: Functor f => (a -> b) -> f a -> f bSource
An infix synonym for fmap.
newLocalName :: Name -> TcRnIf gbl lcl NameSource
duplicateLocalDs :: Id -> DsM IdSource
newSysLocalDs :: Type -> DsM IdSource
newSysLocalsDs :: [Type] -> DsM [Id]Source
newUniqueId :: Name -> Type -> DsM IdSource
newFailLocalDs :: Type -> DsM IdSource
newPredVarDs :: PredType -> DsM VarSource
getSrcSpanDs :: DsM SrcSpanSource
putSrcSpanDs :: SrcSpan -> DsM a -> DsM aSource
getModuleDs :: DsM ModuleSource
newUnique :: TcRnIf gbl lcl UniqueSource
data UniqSupply Source
A value of type UniqSupply is unique, and it can supply one distinct Unique. Also, from the supply, one can also manufacture an arbitrary number of further UniqueSupply values, which will be distinct from the first and from all others.
newUniqueSupply :: TcRnIf gbl lcl UniqSupplySource
getDOptsDs :: DsM DynFlagsSource
getGhcModeDs :: DsM GhcModeSource
doptDs :: DynFlag -> TcRnIf gbl lcl BoolSource
dsLookupGlobal :: Name -> DsM TyThingSource
dsLookupGlobalId :: Name -> DsM IdSource
dsLookupTyCon :: Name -> DsM TyConSource
dsLookupDataCon :: Name -> DsM DataConSource
dsLookupClass :: Name -> DsM ClassSource
type DsMetaEnv = NameEnv DsMetaValSource
data DsMetaVal Source
Constructors
Bound Id
Splice (HsExpr Id)
dsLookupMetaEnv :: Name -> DsM (Maybe DsMetaVal)Source
dsExtendMetaEnv :: DsMetaEnv -> DsM a -> DsM aSource
type DsWarning = (SrcSpan, SDoc)Source
warnDs :: SDoc -> DsM ()Source
failWithDs :: SDoc -> DsM aSource
data DsMatchContext Source
Constructors
DsMatchContext (HsMatchContext Name) SrcSpan
NoMatchContext
data EquationInfo Source
Constructors
EqnInfo
eqn_pats :: [Pat Id]
eqn_rhs :: MatchResult
show/hide Instances
data MatchResult Source
Constructors
MatchResult CanItFail (CoreExpr -> DsM CoreExpr)
type DsWrapper = CoreExpr -> CoreExprSource
idDsWrapper :: DsWrapperSource
data CanItFail Source
Constructors
CanFail
CantFail
orFail :: CanItFail -> CanItFail -> CanItFailSource
Produced by Haddock version 2.6.0