HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

ModuleAgda-2.7.0.1Haskell2010

Agda.Syntax.Parser.Helpers

Utility functions used in the Happy parser.

  • 4 types
  • 48 values
  • PackageAgda-2.7.0.1
  • Exports52
  • LanguageHaskell2010
  • LicenceMIT
  • SourceHelpers.hs

Insert a top-level module if there is none. Also fix-up for the case the declarations in the top-level module are not indented (this is allowed as a special case).

Create a qualified name from a string (used in pragmas). Range of each name component is range of whole string. TODO: precise ranges!

valueonlyErased
  1. :: [Attr]

    The attributes, in reverse order.

  2. -> Parser Erased
#

Returns the value of the first erasure attribute, if any, or else the default value of type Erased.

Raises warnings for all attributes except for erasure attributes, and for multiple erasure attributes.

valueextLam
  1. :: Range

    The range of the lambda symbol and where or the braces.

  2. -> [Attr]

    The attributes in reverse order.

  3. -> List1 LamClause

    The clauses in reverse order.

  4. -> Parser Expr
#

Constructs extended lambdas.

valueexprToName :: Expr -> Parser Name
#

Turn an expression into a name. Fails if the expression is not a valid identifier.

valuemaybeNamed :: Expr -> Parser (Named_ Expr)
#

When given expression is e1 = e2, turn it into a named expression. Call this inside an implicit argument {e} or {{e}}, where an equality must be a named argument (rather than a cubical partial match).

Attributes

10 declarations
valueapplyAttr :: LensAttribute a => Attr -> a -> Parser a
#

Apply an attribute to thing (usually Arg). This will fail if one of the attributes is already set in the thing to something else than the default value.

valueapplyAttrs :: LensAttribute a => [Attr] -> a -> Parser a
#

Apply attributes to thing (usually Arg). Expects a reversed list of attributes. This will fail if one of the attributes is already set in the thing to something else than the default value.