-- 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
--   <a>Show</a> instances. By using the library, we can parse derived
--   <a>Show</a> instances into a generic data structure. The <tt>ppsh</tt>
--   tool uses the library to produce human-readable versions of
--   <a>Show</a> instances, which can be quite handy for debugging Haskell
--   programs.
@package pretty-show
@version 1.2


-- | Functions for human-readable derived <a>Show</a> instances.
module Text.Show.Pretty

-- | A name.
type Name = String

-- | Generic Haskell values. <tt>NaN</tt> and <tt>Infinity</tt> are
--   represented as constructors. The <a>String</a> 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 <a>Show</a> 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 <a>Show</a> instance.
ppDoc :: Show a => a -> Doc

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