libhbb-0.4.1.0: Backend for text editors to provide better Haskell editing support.

Safe HaskellNone

Language.Haskell.HBB.ExprType

Synopsis

Documentation

exprtype :: [String] -> FilePath -> String -> IO (Type, String)Source

This function takes a filename and an expression and evaluates the type of this expression in the context of the passed file. The result value is a tuple where the first element is GHCs representation of the type and the second one is the stringified version of the type.

The first two command line parameter is:

  • The GHC options as string list (as they should appear on the command line, e.g. ["-isrc"])

exprtypeM :: GhcMonad m => FilePath -> String -> m (Type, String)Source

This is a variant of exprtype that runs within the GHC monad and therefore allows a more fine-grained control over the behaviour of GHC.

showExprTypeResult :: (Type, String) -> StringSource

This function creates a string of the result returned by exprtype or exprtypeM.

The string has exactly the format that should be understood by text editors that are using this mode.

data Type

Instances

Data Type 
Typeable Type 
Outputable Type