futhark-0.21.9: An optimising compiler for a functional, array-oriented language.
Safe HaskellNone
LanguageHaskell2010

Language.Futhark.Parser

Description

Interface to the Futhark parser.

Synopsis

Documentation

parseFuthark :: FilePath -> Text -> Either SyntaxError UncheckedProg Source #

Parse an entire Futhark program from the given Text, using the FilePath as the source name for error messages.

parseExp :: FilePath -> Text -> Either SyntaxError UncheckedExp Source #

Parse an Futhark expression from the given String, using the FilePath as the source name for error messages.

parseModExp :: FilePath -> Text -> Either SyntaxError (ModExpBase NoInfo Name) Source #

Parse a Futhark module expression from the given String, using the FilePath as the source name for error messages.

parseType :: FilePath -> Text -> Either SyntaxError UncheckedTypeExp Source #

Parse an Futhark type from the given String, using the FilePath as the source name for error messages.

parseValue :: FilePath -> Text -> Either SyntaxError Value Source #

Parse any Futhark value from the given String, using the FilePath as the source name for error messages.

parseValues :: FilePath -> Text -> Either SyntaxError [Value] Source #

Parse several Futhark values (separated by anything) from the given String, using the FilePath as the source name for error messages.

parseDecOrExpIncrM :: Monad m => m Text -> FilePath -> Text -> m (Either SyntaxError (Either UncheckedDec UncheckedExp)) Source #

Parse either an expression or a declaration incrementally; favouring declarations in case of ambiguity.

data SyntaxError Source #

A syntax error.

Constructors

SyntaxError