Safe Haskell | None |
---|
- 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
- ifDOptM :: DynFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()
- unsetDOptM :: DynFlag -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a
- unsetWOptM :: WarningFlag -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a
- class Functor f => Applicative f where
- (<$>) :: 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 :: Id -> Type -> DsM Id
- newFailLocalDs :: Type -> DsM Id
- newPredVarDs :: PredType -> DsM Var
- getSrcSpanDs :: DsM SrcSpan
- putSrcSpanDs :: SrcSpan -> DsM a -> DsM a
- getModuleDs :: DsM Module
- mkPrintUnqualifiedDs :: DsM PrintUnqualified
- newUnique :: TcRnIf gbl lcl Unique
- data UniqSupply
- newUniqueSupply :: TcRnIf gbl lcl UniqSupply
- getDOptsDs :: DsM DynFlags
- getGhcModeDs :: DsM GhcMode
- doptDs :: DynFlag -> TcRnIf gbl lcl Bool
- woptDs :: WarningFlag -> TcRnIf gbl lcl Bool
- dsLookupGlobal :: Name -> DsM TyThing
- dsLookupGlobalId :: Name -> DsM Id
- dsDPHBuiltin :: (PArrBuiltin -> a) -> DsM a
- dsLookupTyCon :: Name -> DsM TyCon
- dsLookupDataCon :: Name -> DsM DataCon
- data PArrBuiltin = PArrBuiltin {
- lengthPVar :: Var
- replicatePVar :: Var
- singletonPVar :: Var
- mapPVar :: Var
- filterPVar :: Var
- zipPVar :: Var
- crossMapPVar :: Var
- indexPVar :: Var
- emptyPVar :: Var
- appPVar :: Var
- enumFromToPVar :: Var
- enumFromThenToPVar :: Var
- dsLookupDPHRdrEnv :: OccName -> DsM Name
- dsLookupDPHRdrEnv_maybe :: OccName -> DsM (Maybe Name)
- dsInitPArrBuiltin :: DsM a -> DsM a
- type DsMetaEnv = NameEnv DsMetaVal
- data DsMetaVal
- 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
- 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
- orFail :: CanItFail -> CanItFail -> CanItFail
Documentation
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.
unsetDOptM :: DynFlag -> TcRnIf gbl lcl a -> TcRnIf gbl lcl aSource
unsetWOptM :: WarningFlag -> TcRnIf gbl lcl a -> TcRnIf gbl lcl aSource
class Functor f => Applicative f whereSource
A functor with application, providing operations to
A minimal complete definition must include implementations of these functions satisfying 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
The other methods have the following default definitions, which may be overridden with equivalent specialized implementations:
u*>
v =pure
(const
id
)<*>
u<*>
v u<*
v =pure
const
<*>
u<*>
v
As a consequence of these laws, the Functor
instance for f
will satisfy
fmap
f x =pure
f<*>
x
If f
is also a Monad
, it should satisfy
and
pure
= return
(
(which implies that <*>
) = ap
pure
and <*>
satisfy the
applicative functor laws).
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.
Applicative [] | |
Applicative IO | |
Applicative Q | |
Applicative Maybe | |
Applicative Id | |
Applicative ZipList | |
Applicative STM | |
Applicative Id | |
Applicative UniqSM | |
Applicative Pair | |
Applicative VM | |
Applicative CoreM | |
Applicative ((->) a) | |
Applicative (Either e) | |
Monoid a => Applicative ((,) a) | |
Applicative (ST s) | |
Applicative (StateL s) | |
Applicative (StateR s) | |
Monoid m => Applicative (Const m) | |
Monad m => Applicative (WrappedMonad m) | |
Applicative (ST s) | |
Applicative (State s) | |
Applicative (State s) | |
Applicative (IOEnv m) | |
Arrow a => Applicative (WrappedArrow a b) |
newLocalName :: Name -> TcRnIf gbl lcl NameSource
duplicateLocalDs :: Id -> DsM IdSource
newSysLocalDs :: Type -> DsM IdSource
newSysLocalsDs :: [Type] -> DsM [Id]Source
newFailLocalDs :: Type -> DsM IdSource
newPredVarDs :: PredType -> DsM VarSource
putSrcSpanDs :: SrcSpan -> DsM a -> DsM aSource
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
woptDs :: WarningFlag -> TcRnIf gbl lcl BoolSource
dsLookupGlobal :: Name -> DsM TyThingSource
dsLookupGlobalId :: Name -> DsM IdSource
dsDPHBuiltin :: (PArrBuiltin -> a) -> DsM aSource
Get a name from Data.Array.Parallel for the desugarer, from the ds_parr_bi
component of the
global desugerar environment.
dsLookupTyCon :: Name -> DsM TyConSource
dsLookupDataCon :: Name -> DsM DataConSource
data PArrBuiltin Source
PArrBuiltin | |
|
dsInitPArrBuiltin :: DsM a -> DsM aSource
dsExtendMetaEnv :: DsMetaEnv -> DsM a -> DsM aSource
failWithDs :: SDoc -> DsM aSource
data MatchResult Source