- data ExprView e
- class HasRange e => IsExpr e where
- exprView :: e -> ExprView e
- unExprView :: ExprView e -> e
- recursive :: (ReadP tok a -> [ReadP tok a -> ReadP tok a]) -> ReadP tok a
- chainr1' :: ReadP t a -> ReadP t (a -> a -> ReadP t a) -> ReadP t a
- chainl1' :: ReadP t a -> ReadP t (a -> a -> ReadP t a) -> ReadP t a
- partP :: IsExpr e => String -> ReadP e (Range, NamePart)
- binop :: IsExpr e => ReadP e (NewNotation, Range, [e]) -> ReadP e (e -> e -> ReadP a e)
- preop, postop :: IsExpr e => ReadP e (NewNotation, Range, [e]) -> ReadP e (e -> ReadP a e)
- opP :: IsExpr e => ReadP e e -> NewNotation -> ReadP e (NewNotation, Range, [e])
- rebuild :: forall symbol e. IsExpr e => NewNotation -> Range -> [e] -> ReadP symbol e
- rebuildBinding :: ExprView e -> ReadP a LamBinding
- ($$$) :: (e -> ReadP a e) -> ReadP a e -> ReadP a e
- infixP, nonfixP, prefixP, postfixP, infixlP, infixrP :: IsExpr e => ReadP e (NewNotation, Range, [e]) -> ReadP e e -> ReadP e e
- appP :: IsExpr e => ReadP e e -> ReadP e e -> ReadP e e
- atomP :: IsExpr e => (Name -> Bool) -> ReadP e e
Documentation
Parser combinators
recursive :: (ReadP tok a -> [ReadP tok a -> ReadP tok a]) -> ReadP tok aSource
Combining a hierarchy of parsers.
partP :: IsExpr e => String -> ReadP e (Range, NamePart)Source
Parse a specific identifier as a NamePart
opP :: IsExpr e => ReadP e e -> NewNotation -> ReadP e (NewNotation, Range, [e])Source
Parse the operator part of the given syntax. holes at beginning and end are IGNORED.
rebuild :: forall symbol e. IsExpr e => NewNotation -> Range -> [e] -> ReadP symbol eSource
Given a name with a syntax spec, and a list of parsed expressions fitting it, rebuild the expression. Note that this function must not parse any input (as guaranteed by the type)
rebuildBinding :: ExprView e -> ReadP a LamBindingSource