| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Text.Show.Prettyprint.Internal
Description
This module may change arbitrarily between versions. It is exposed only for documentary purposes.
Documentation
Prettyparser for a constructor, which is roughly a word applied to arguments.
>>>testParse valueP "Just ('c', Left ())"Just ('c',Left ())
identifierP :: Parser Doc 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 Source #
Number in integer or scientific notation.
>>>testParse numberP "123456"123456
>>>testParse numberP "-123.4e56"-1.234e58
stringLitP :: Parser Doc Source #
>>>testParse stringLitP "\"Hello world!\"""Hello world!"
Anything that could be considered an argument to something else.
>>>testParse argP "()"()
>>>testParse argP "['h', 'e', 'l', 'l', 'o']"['h','e','l','l','o']
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')
List prettyparser. Lists can be heterogeneous, which is realistic if we consider ill-defined Show instances.
>>>testParse listP "[\"Hello\", World]"["Hello",World]