ghc-7.0.4: The GHC API

OptimizationFuel

Description

Optimisation fuel is used to control the amount of work the optimiser does.

Every optimisation step consumes a certain amount of fuel and stops when it runs out of fuel. This can be used e.g. to debug optimiser bugs: Run the optimiser with varying amount of fuel to find out the exact number of steps where a bug is introduced in the output.

# Documentation

data OptimizationFuel Source

Instances

Show OptimizationFuel |

canRewriteWithFuel :: OptimizationFuel -> Bool Source

maybeRewriteWithFuel :: OptimizationFuel -> Maybe a -> Maybe aSource

oneLessFuel :: OptimizationFuel -> OptimizationFuel Source

data OptFuelState Source

initOptFuelState :: IO OptFuelState Source

tankFilledTo :: Int -> OptimizationFuel Source

diffFuel :: OptimizationFuel -> OptimizationFuel -> Int Source

type FuelConsumer a = OptimizationFuel -> (a, OptimizationFuel)Source

class Monad m => FuelUsingMonad m where Source

Methods

fuelRemaining :: m OptimizationFuel Source

fuelDecrement :: String -> OptimizationFuel -> OptimizationFuel -> m ()Source

fuelDec1 :: m ()Source

fuelExhausted :: m Bool Source

lastFuelPass :: m String Source

Instances

FuelUsingMonad FuelMonad |
FuelUsingMonad (DFM' FuelMonad f) |

data FuelState Source

runFuelIO :: OptFuelState -> FuelMonad a -> IO aSource

fuelConsumingPass :: String -> FuelConsumer a -> FuelMonad aSource

data FuelMonad a Source

Instances

Monad FuelMonad |
MonadUnique FuelMonad |
FuelUsingMonad FuelMonad |
MonadUnique (DFM' FuelMonad f) |
FuelUsingMonad (DFM' FuelMonad f) |

liftUniq :: UniqSM x -> FuelMonad xSource

lGraphOfGraph :: Graph m l -> FuelMonad (LGraph m l)Source