-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Tools for working with derived Show instances.
--   
--   We provide a library and an executable for working with derived
--   Show instances. By using the library, we can parse derived
--   Show instances into a generic data structure. The ppsh
--   tool uses the library to produce human-readable versions of
--   Show instances, which can be quite handy for debugging Haskell
--   programs.
@package pretty-show
@version 1.2

-- | Functions for human-readable derived Show instances.
module Text.Show.Pretty

-- | A name.
type Name = String

-- | Generic Haskell values. NaN and Infinity are
--   represented as constructors. The String in the literals is the
--   text for the literals "as is".
data Value

-- | Data constructor
Con :: Name -> [Value] -> Value

-- | Record value
Rec :: Name -> [(Name, Value)] -> Value

-- | Tuple
Tuple :: [Value] -> Value

-- | List
List :: [Value] -> Value

-- | Negated value
Neg :: Value -> Value

-- | Rational
Ratio :: Value -> Value -> Value

-- | Non-negative integer
Integer :: String -> Value

-- | Non-negative floating num.
Float :: String -> Value

-- | Character
Char :: String -> Value

-- | String
String :: String -> Value
parseValue :: String -> Maybe Value
reify :: Show a => a -> Maybe Value

-- | Pretty print a generic value. Our intention is that the result is
--   equivalent to the Show instance for the original value, except
--   possibly easier to understand by a human.
ppValue :: Value -> Doc

-- | Try to show a value, prettily. If we do not understand the value, then
--   we just use its standard Show instance.
ppDoc :: Show a => a -> Doc

-- | Convert a generic value into a pretty String, if possible.
ppShow :: Show a => a -> String
