ghc-8.2.2: The GHC API

Safe Haskell | None
Language | Haskell2010

SimplMonad

Synopsis

- data SimplM result
- initSmpl :: DynFlags -> RuleEnv -> (FamInstEnv, FamInstEnv) -> UniqSupply -> Int -> SimplM a -> IO (a, SimplCount)
- traceSmpl :: String -> SDoc -> SimplM ()
- getSimplRules :: SimplM RuleEnv
- getFamEnvs :: SimplM (FamInstEnv, FamInstEnv)
- class Monad m => MonadUnique m where
- newId :: FastString -> Type -> SimplM Id
- data SimplCount
- tick :: Tick -> SimplM ()
- freeTick :: Tick -> SimplM ()
- checkedTick :: Tick -> SimplM ()
- getSimplCount :: SimplM SimplCount
- zeroSimplCount :: DynFlags -> SimplCount
- pprSimplCount :: SimplCount -> SDoc
- plusSimplCount :: SimplCount -> SimplCount -> SimplCount
- isZeroSimplCount :: SimplCount -> Bool

# Documentation

data SimplM result #

Instances

Monad SimplM # |
Methods (>>=) :: SimplM a -> (a -> SimplM b) -> SimplM b Source # (>>) :: SimplM a -> SimplM b -> SimplM b Source # return :: a -> SimplM a Source # fail :: String -> SimplM a Source #
Functor SimplM # |
Methods fmap :: (a -> b) -> SimplM a -> SimplM b Source # (<$) :: a -> SimplM b -> SimplM a Source #
Applicative SimplM # |
Methods pure :: a -> SimplM a Source # (<*>) :: SimplM (a -> b) -> SimplM a -> SimplM b Source # liftA2 :: (a -> b -> c) -> SimplM a -> SimplM b -> SimplM c Source # (*>) :: SimplM a -> SimplM b -> SimplM b Source # (<*) :: SimplM a -> SimplM b -> SimplM a Source #
MonadIO SimplM # |
Methods liftIO :: IO a -> SimplM a Source #
MonadUnique SimplM # |
Methods getUniqueSupplyM :: SimplM UniqSupply # getUniqueM :: SimplM Unique # getUniquesM :: SimplM [Unique] #
HasDynFlags SimplM # |
Methods getDynFlags :: SimplM DynFlags #

initSmpl :: DynFlags -> RuleEnv -> (FamInstEnv, FamInstEnv) -> UniqSupply -> Int -> SimplM a -> IO (a, SimplCount) #

traceSmpl :: String -> SDoc -> SimplM () #

getSimplRules :: SimplM RuleEnv #

getFamEnvs :: SimplM (FamInstEnv, FamInstEnv) #

class Monad m => MonadUnique m where #

A monad for generating unique identifiers

Minimal complete definition

getUniqueSupplyM

Methods

getUniqueSupplyM :: m UniqSupply #

Get a new UniqueSupply

getUniqueM :: m Unique #

Get a new unique identifier

getUniquesM :: m [Unique] #

Get an infinite list of new unique identifiers

Instances

MonadUnique UniqSM # |
Methods getUniqueSupplyM :: UniqSM UniqSupply # getUniqueM :: UniqSM Unique # getUniquesM :: UniqSM [Unique] #
MonadUnique LlvmM # |
Methods getUniqueSupplyM :: LlvmM UniqSupply # getUniqueM :: LlvmM Unique # getUniquesM :: LlvmM [Unique] #
MonadUnique FCode # |
Methods getUniqueSupplyM :: FCode UniqSupply # getUniqueM :: FCode Unique # getUniquesM :: FCode [Unique] #
MonadUnique CmmParse # |
Methods getUniqueSupplyM :: CmmParse UniqSupply # getUniqueM :: CmmParse Unique # getUniquesM :: CmmParse [Unique] #
MonadUnique CoreM # |
Methods getUniqueSupplyM :: CoreM UniqSupply # getUniqueM :: CoreM Unique # getUniquesM :: CoreM [Unique] #
MonadUnique SimplM # |
Methods getUniqueSupplyM :: SimplM UniqSupply # getUniqueM :: SimplM Unique # getUniquesM :: SimplM [Unique] #
MonadUnique TcS # |
Methods getUniqueSupplyM :: TcS UniqSupply # getUniqueM :: TcS Unique # getUniquesM :: TcS [Unique] #
MonadUnique NatM # |
Methods getUniqueSupplyM :: NatM UniqSupply # getUniqueM :: NatM Unique # getUniquesM :: NatM [Unique] #

newId :: FastString -> Type -> SimplM Id #

data SimplCount #

tick :: Tick -> SimplM () #

freeTick :: Tick -> SimplM () #

checkedTick :: Tick -> SimplM () #

getSimplCount :: SimplM SimplCount #

zeroSimplCount :: DynFlags -> SimplCount #

pprSimplCount :: SimplCount -> SDoc #

plusSimplCount :: SimplCount -> SimplCount -> SimplCount #

isZeroSimplCount :: SimplCount -> Bool #