Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- parse ∷ (AsParserErrorBundle e, MonadError e m, MonadQuote m) ⇒ Parser a → String → Text → m a
- term ∷ Parser PTerm
- program ∷ Parser (Program Name DefaultUni DefaultFun SrcSpan)
- parseTerm ∷ (AsParserErrorBundle e, MonadError e m, MonadQuote m) ⇒ Text → m PTerm
- parseProgram ∷ (AsParserErrorBundle e, MonadError e m, MonadQuote m) ⇒ Text → m (Program Name DefaultUni DefaultFun SrcSpan)
- parseScoped ∷ (AsParserErrorBundle e, AsUniqueError e SrcSpan, MonadError e m, MonadQuote m) ⇒ Text → m (Program Name DefaultUni DefaultFun SrcSpan)
- type Parser = ParsecT ParserError Text (StateT ParserState (ReaderT (Maybe Version) Quote))
- data SourcePos
Documentation
parse ∷ (AsParserErrorBundle e, MonadError e m, MonadQuote m) ⇒ Parser a → String → Text → m a Source #
program ∷ Parser (Program Name DefaultUni DefaultFun SrcSpan) Source #
Parser for UPLC programs.
parseTerm ∷ (AsParserErrorBundle e, MonadError e m, MonadQuote m) ⇒ Text → m PTerm Source #
Parse a UPLC term. The resulting program will have fresh names. The underlying monad must be capable of handling any parse errors.
parseProgram ∷ (AsParserErrorBundle e, MonadError e m, MonadQuote m) ⇒ Text → m (Program Name DefaultUni DefaultFun SrcSpan) Source #
parseScoped ∷ (AsParserErrorBundle e, AsUniqueError e SrcSpan, MonadError e m, MonadQuote m) ⇒ Text → m (Program Name DefaultUni DefaultFun SrcSpan) Source #
Parse and rewrite so that names are globally unique, not just unique within their scope.
type Parser = ParsecT ParserError Text (StateT ParserState (ReaderT (Maybe Version) Quote)) Source #
The data type SourcePos
represents source positions. It contains the
name of the source file, a line number, and a column number. Source line
and column positions change intensively during parsing, so we need to
make them strict to avoid memory leaks.