ghc-mtl-1.2.1.0: An mtl compatible version of the Ghc-Api monads and monad-transformers.

Safe HaskellNone

Control.Monad.Ghc

Synopsis

Documentation

class (Functor m, MonadIO m, ExceptionMonad m, HasDynFlags m) => GhcMonad m where

A monad that has all the features needed by GHC API calls.

In short, a GHC monad

  • allows embedding of IO actions,
  • can log warnings,
  • allows handling of (extensible) exceptions, and
  • maintains a current session.

If you do not use Ghc or GhcT, make sure to call initGhcMonad before any call to the GHC API functions can occur.

Methods

getSession :: m HscEnv

setSession :: HscEnv -> m ()