futhark-0.21.7: 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 ParseError 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 ParseError UncheckedExp Source #

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

parseModExp :: FilePath -> Text -> Either ParseError (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 ParseError UncheckedTypeExp Source #

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

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

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

parseValues :: FilePath -> Text -> Either ParseError [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 ParseError (Either UncheckedDec UncheckedExp)) Source #

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

data ParseError Source #

A parse error. Use show to get a human-readable description.

Instances

Instances details
Show ParseError Source # 
Instance details

Defined in Language.Futhark.Parser.Monad