HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduledhall-1.42.3Haskell2010

Dhall.Parser

This module contains Dhall's parsing logic

  • 5 types
  • 6 values
  • Packagedhall-1.42.3
  • Exports11
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceParser.hs

Utilities

4 declarations
valueexprAndHeaderFromText
  1. :: String

    User-friendly name describing the input expression, used in parsing error messages

  2. -> Text

    Input expression to parse

  3. -> Either ParseError (Header, Expr Src Import)
#

Like exprFromText but also returns the leading comments and whitespace (i.e. header) up to the last newline before the code begins

In other words, if you have a Dhall file of the form:

-- Comment 1
{- Comment -} 2

Then this will preserve Comment 1, but not Comment 2

This is used by dhall-format to preserve leading comments and whitespace

valuecensor :: ParseError -> ParseError
#

Replace the source code with spaces when rendering error messages

This utility is used to implement the --censor flag

Parsers

2 declarations
valueexprA :: Parser a -> Parser (Expr Src a)
#

Deprecated. Support for parsing custom imports will be dropped in a future release

Parser for a top-level Dhall expression. The expression is parameterized over any parseable type, allowing the language to be extended as needed.

Types

5 declarations
newtypenewtype Header
#

A header corresponds to the leading comment at the top of a Dhall file.

The header includes comment characters but is stripped of leading spaces and trailing newlines

Constructors

Instances1Show
  • Show HeaderDefined in dhall-1.42.3 · Dhall.Parser
datadata Src
#

Source code extract

Instances9Eq, Data, Ord, Show, Generic, NFData, …
newtypenewtype Parser a
#

A Parser that is almost identical to Text.Megaparsec.Parsec except treating Haskell-style comments as whitespace

Constructors

Instances13Monad, Functor, MonadFail, Applicative, Alternative, MonadPlus, …