futhark-data-1.1.2.0: An implementation of the Futhark data format.

Safe Haskell | None
Language | Haskell2010

Futhark.Data.Parser

Description

Megaparsec-based parser for `Value`s in the textual value format. The difference between this and the reader defined in Futhark.Data.Reader is that we don't try to handle both the textual and binary format - only the former. On the other hand, this parser has (much) better error messages and can be easily used by other parsers (like the ones for FutharkScript or test blocks).

Synopsis

- parsePrimType :: Parsec Void Text PrimType
- parseType :: Parsec Void Text ValueType
- parsePrimValue :: Parsec Void Text Value
- parseValue :: Parsec Void Text () -> Parsec Void Text Value

# Documentation

parsePrimType :: Parsec Void Text PrimType Source #

Parse the name of a primitive type. Does *not* consume any trailing whitespace, nor does it permit any internal whitespace.

parseType :: Parsec Void Text ValueType Source #

Parse a type. Does *not* consume any trailing whitespace, nor does it permit any internal whitespace.

parsePrimValue :: Parsec Void Text Value Source #

Parse a primitive value. Does *not* consume any trailing whitespace, nor does it permit any internal whitespace.

parseValue :: Parsec Void Text () -> Parsec Void Text Value Source #

Parse a value, given a post-lexeme parser for whitespace.