ghc-hs-meta
Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Meta.Parse

Description

This module is here to parse Haskell expression using the GHC Api

Synopsis
  • parseExp :: String -> Either (Int, Int, String) Exp
  • parseExpWithExts :: [Extension] -> String -> Either (Int, Int, String) Exp
  • parseExpWithFlags :: DynFlags -> String -> Either (Int, Int, String) Exp
  • parseHsExpr :: DynFlags -> String -> Either (Int, Int, String) (HsExpr GhcPs)

Documentation

parseExp :: String -> Either (Int, Int, String) Exp Source #

Parse a Haskell expression from source code into a Template Haskell expression. See parseExpWithExts or parseExpWithFlags for customizing with additional extensions and settings.

parseExpWithExts :: [Extension] -> String -> Either (Int, Int, String) Exp Source #

Parse a Haskell expression from source code into a Template Haskell expression using a given set of GHC extensions.

parseExpWithFlags :: DynFlags -> String -> Either (Int, Int, String) Exp Source #

Parse a Haskell expression from source code into a Template Haskell expression using a given set of GHC DynFlags.

parseHsExpr :: DynFlags -> String -> Either (Int, Int, String) (HsExpr GhcPs) Source #

Run the GHC parser to parse a Haskell expression into a HsExpr.