pretty-show-1: Tools for working with derived Show instances.Source codeContentsIndex
Text.Show.Pretty
PortabilityHaskell 98
Stabilityprovisional
Maintaineriavor.diatchki@gmail.com
Description
Functions for human-readable derived show instances.
Synopsis
type Name = String
data Value
= Con Name [Value]
| Rec Name [(Name, Value)]
| Tuple [Value]
| List [Value]
| Other String
parseValue :: String -> Maybe Value
ppValue :: Value -> Doc
ppDoc :: Show a => a -> Doc
ppShow :: Show a => a -> String
Documentation
type Name = StringSource
A name.
data Value Source
Generic Haskell values
Constructors
Con Name [Value]Data constructor
Rec Name [(Name, Value)]Record value
Tuple [Value]Tuple
List [Value]List
Other StringSomething else (e.g. number)
show/hide Instances
parseValue :: String -> Maybe ValueSource
ppValue :: Value -> DocSource
Pretty print a generic value. Our intention is that the result is equivalent to the show insrnace for the origianl value, except possivly easier to unserstand by a human.
ppDoc :: Show a => a -> DocSource
Try to show a value, prettily. If we do not undertant the value, then we just use its standard show instance.
ppShow :: Show a => a -> StringSource
Convert a generic value into a pretty String, if possible.
Produced by Haddock version 2.4.2