Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module may change arbitrarily between versions. It is exposed only for documentary purposes.
Synopsis
- parseShowString :: String -> Result (Doc ann)
- shownP :: Parser (Doc ann)
- valueP :: Parser (Doc ann)
- identifierP :: Parser (Doc ann)
- numberP :: Parser (Doc ann)
- stringLitP :: Parser (Doc ann)
- charLitP :: Parser (Doc ann)
- argP :: Parser (Doc ann)
- unitP :: Parser (Doc ann)
- tupleP :: Parser (Doc ann)
- listP :: Parser (Doc ann)
- recordP :: Parser (Doc ann)
Documentation
valueP :: Parser (Doc ann) Source #
Prettyparser for a constructor, which is roughly a word applied to arguments.
>>>
testParse valueP "Just ('c', Left ())"
Just ('c',Left ())
identifierP :: Parser (Doc ann) Source #
An identifier is a liberal version of a "variable or constructor", which roughly means that it's a printable word without parentheses.
>>>
testParse identifierP "_foo'bar"
_foo'bar
numberP :: Parser (Doc ann) Source #
Number in integer or scientific notation.
>>>
testParse numberP "123456"
123456
>>>
testParse numberP "-123.4e56"
-1.234e58
stringLitP :: Parser (Doc ann) Source #
>>>
testParse stringLitP "\"Hello\\\\ world!\""
"Hello\\ world!"
argP :: Parser (Doc ann) Source #
Anything that could be considered an argument to something else.
>>>
testParse argP "()"
()
>>>
testParse argP "['h', 'e', 'l', 'l', 'o']"
['h','e','l','l','o']
tupleP :: Parser (Doc ann) Source #
Prettyparser for tuples from size 1. Since 1-tuples are just parenthesized expressions to first order approximation, this parser handles those as well.
>>>
testParse tupleP "((), True, 'c')"
((),True,'c')