HORIZON HASKELLDocsmaster5ff592b2026-10-19Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · master · 5ff592b · 2026-10-19

Moduleghc-10.0.0.20260917GHC2024

GHC.Parser

This module provides the generated Happy parser for Haskell. It exports a number of parsers which may be used in any library that uses the GHC API. A common usage pattern is to initialize the parser state with a given string and then parse that string:

    runParser :: ParserOpts -> String -> P a -> ParseResult a
    runParser opts str parser = unP parser parseState
    where
      filename = "<interactive>"
      location = mkRealSrcLoc (mkFastString filename) 1 1
      buffer = stringToStringBuffer str
      parseState = initParserState opts buffer location
  • 14 values