ghc-7.0.3: 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

Instances

Show OptimizationFuel |

canRewriteWithFuel :: OptimizationFuel -> Bool

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

oneLessFuel :: OptimizationFuel -> OptimizationFuel

data OptFuelState

initOptFuelState :: IO OptFuelState

tankFilledTo :: Int -> OptimizationFuel

diffFuel :: OptimizationFuel -> OptimizationFuel -> Int

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

class Monad m => FuelUsingMonad m where

Methods

fuelRemaining :: m OptimizationFuel

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

fuelDec1 :: m ()

fuelExhausted :: m Bool

lastFuelPass :: m String

Instances

FuelUsingMonad FuelMonad |
FuelUsingMonad (DFM' FuelMonad f) |

data FuelState

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

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

data FuelMonad a

Instances

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

liftUniq :: UniqSM x -> FuelMonad x

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