ghc-7.10.3: The GHC API

Safe HaskellNone
LanguageHaskell2010

TcPluginM

Contents

Description

This module provides an interface for typechecker plugins to access select functions of the TcM, principally those to do with reading parts of the state.

Synopsis

Basic TcPluginM functionality

tcPluginIO :: IO a -> TcPluginM a Source

Perform some IO, typically to interact with an external tool.

tcPluginTrace :: String -> SDoc -> TcPluginM () Source

Output useful for debugging the compiler.

unsafeTcPluginTcM :: TcM a -> TcPluginM a Source

This function provides an escape for direct access to the TcM monad. It should not be used lightly, and the provided TcPluginM API should be favoured instead.

Finding Modules and Names

data FindResult Source

The result of searching for an imported module.

Constructors

Found ModLocation Module

The module was found

NoPackage PackageKey

The requested package was not found

FoundMultiple [(Module, ModuleOrigin)]

_Error_: both in multiple packages

NotFound

Not found

Looking up Names in the typechecking environment

Getting the TcM state

Type variables

Zonking