| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Howl.Parser
Description
Parse Wolfram Language expressions.
The parsed expression may be a compound expression, e.g. a sequence of semicolon-separated subexpressions.
Synopsis
- parseExprText :: Text -> Either String Expr
- readExprFile :: MonadIO m => FilePath -> m (Either String Expr)
- normalizeParsedExpr :: Expr -> Expr
Documentation
readExprFile :: MonadIO m => FilePath -> m (Either String Expr) #
Read and parse an expression from a file.
normalizeParsedExpr :: Expr -> Expr #
Normalize an expression into the canonical form used by Howl.
This is used for parser internals and tests. Users
should prefer parseExprText, which already applies this
normalization.
The normalization pass rewrites some surface syntax into more
uniform expression forms. For example, it replaces - and / with
expressions built from Plus, Times, and Power, flattens
associative heads such as Plus and Times, and removes redundant
Sequence wrappers.