ghc-7.8.20140130: The GHC API

Safe HaskellNone
LanguageHaskell98

DsMonad

Synopsis

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.

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

whenGOptM :: GeneralFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl ()Source

unsetGOptM :: GeneralFlag -> 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

  • embed pure expressions (pure), and
  • sequence computations and combine their results (<*>).

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 pure = return and (<*>) = ap (which implies that pure and <*> satisfy the applicative functor laws).

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.

(<$>) :: Functor f => (a -> b) -> f a -> f bSource

An infix synonym for fmap.

data UniqSupplySource

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.

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.

data PArrBuiltinSource

Constructors

PArrBuiltin 

Fields

lengthPVar :: Var

lengthP

replicatePVar :: Var

replicateP

singletonPVar :: Var

singletonP

mapPVar :: Var

mapP

filterPVar :: Var

filterP

zipPVar :: Var

zipP

crossMapPVar :: Var

crossMapP

indexPVar :: Var

(!:)

emptyPVar :: Var

emptyP

appPVar :: Var

(+:+)

enumFromToPVar :: Var

enumFromToP

enumFromThenToPVar :: Var

enumFromThenToP

dsLookupDPHRdrEnv :: OccName -> DsM NameSource

Lookup a name exported by Prim or Prim. Panic if there isn't one, or if it is defined multiple times.

dsLookupDPHRdrEnv_maybe :: OccName -> DsM (Maybe Name)Source

Lookup a name exported by Prim or Prim, returning Nothing if it's not defined. Panic if it's defined multiple times.

data DsMetaValSource

Constructors

Bound Id 
Splice (HsExpr Id) 

data EquationInfoSource

Constructors

EqnInfo 

Fields

eqn_pats :: [Pat Id]
 
eqn_rhs :: MatchResult
 

data CanItFailSource

Constructors

CanFail 
CantFail