ghc-lib-parser-9.12.2.20250421: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Core.Opt.Simplify.Monad

Synopsis

- data TopEnvConfig = TopEnvConfig {
  - te_history_size :: !Int
  - te_tick_factor :: !Int
  }
- data SimplM result
- initSmpl :: Logger -> IO RuleEnv -> TopEnvConfig -> Int -> SimplM a -> IO (a, SimplCount)
- traceSmpl :: String -> SDoc -> SimplM ()
- getSimplRules :: SimplM RuleEnv
- class Monad m => MonadUnique (m :: Type -> Type) where
  - getUniqueSupplyM :: m UniqSupply
  - getUniqueM :: m Unique
  - getUniquesM :: m [Unique]
- newId :: FastString -> Mult -> Type -> SimplM Id
- newJoinId :: [Var] -> Type -> SimplM Id
- data SimplCount
- tick :: Tick -> SimplM ()
- freeTick :: Tick -> SimplM ()
- checkedTick :: Tick -> SimplM ()
- getSimplCount :: SimplM SimplCount
- zeroSimplCount :: Bool -> SimplCount
- pprSimplCount :: SimplCount -> SDoc
- plusSimplCount :: SimplCount -> SimplCount -> SimplCount
- isZeroSimplCount :: SimplCount -> Bool

# Documentation

data TopEnvConfig Source #

Constructors

TopEnvConfig |

Fields

- te_history_size :: !Int
- te_tick_factor :: !Int

data SimplM result Source #

#### Instances

Instances details

MonadIO SimplM Source # |
Instance details Defined in GHC.Core.Opt.Simplify.Monad Methods liftIO :: IO a -> SimplM a Source #
Applicative SimplM Source # |
Instance details Defined in GHC.Core.Opt.Simplify.Monad 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 #
Functor SimplM Source # |
Instance details Defined in GHC.Core.Opt.Simplify.Monad Methods fmap :: (a -> b) -> SimplM a -> SimplM b Source # (<$) :: a -> SimplM b -> SimplM a Source #
Monad SimplM Source # |
Instance details Defined in GHC.Core.Opt.Simplify.Monad Methods (>>=) :: SimplM a -> (a -> SimplM b) -> SimplM b Source # (>>) :: SimplM a -> SimplM b -> SimplM b Source # return :: a -> SimplM a Source #
MonadUnique SimplM Source # |
Instance details Defined in GHC.Core.Opt.Simplify.Monad Methods getUniqueSupplyM :: SimplM UniqSupply Source # getUniqueM :: SimplM Unique Source # getUniquesM :: SimplM [Unique] Source #
HasLogger SimplM Source # |
Instance details Defined in GHC.Core.Opt.Simplify.Monad Methods getLogger :: SimplM Logger Source #

initSmpl Source #

Arguments

:: Logger |
-> IO RuleEnv |
-> TopEnvConfig |
-> Int | Size of the bindings, used to limit the number of ticks we allow
-> SimplM a |
-> IO (a, SimplCount) |

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

getSimplRules :: SimplM RuleEnv Source #

class Monad m => MonadUnique (m :: Type -> Type) where Source #

A monad for generating unique identifiers

Minimal complete definition

getUniqueSupplyM

Methods

getUniqueSupplyM :: m UniqSupply Source #

Get a new UniqueSupply

getUniqueM :: m Unique Source #

Get a new unique identifier

getUniquesM :: m [Unique] Source #

Get an infinite list of new unique identifiers

#### Instances

Instances details

MonadUnique CoreM Source # |
Instance details Defined in GHC.Core.Opt.Monad Methods getUniqueSupplyM :: CoreM UniqSupply Source # getUniqueM :: CoreM Unique Source # getUniquesM :: CoreM [Unique] Source #
MonadUnique SimplM Source # |
Instance details Defined in GHC.Core.Opt.Simplify.Monad Methods getUniqueSupplyM :: SimplM UniqSupply Source # getUniqueM :: SimplM Unique Source # getUniquesM :: SimplM [Unique] Source #
MonadUnique UniqSM Source # |
Instance details Defined in GHC.Types.Unique.Supply Methods getUniqueSupplyM :: UniqSM UniqSupply Source # getUniqueM :: UniqSM Unique Source # getUniquesM :: UniqSM [Unique] Source #

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

newJoinId :: [Var] -> Type -> SimplM Id Source #

Make a join id with given type and arity but without call-by-value annotations.

data SimplCount Source #

tick :: Tick -> SimplM () Source #

freeTick :: Tick -> SimplM () Source #

checkedTick :: Tick -> SimplM () Source #

getSimplCount :: SimplM SimplCount Source #

zeroSimplCount Source #

Arguments

:: Bool

- ddump-simpl-stats

-> SimplCount |

pprSimplCount :: SimplCount -> SDoc Source #

plusSimplCount :: SimplCount -> SimplCount -> SimplCount Source #

isZeroSimplCount :: SimplCount -> Bool Source #