-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A generic, derivable, haskell pretty printer. -- -- GenericPretty is a haskell library that provides support for automatic -- derivation of pretty printing functions on user defined data types. -- The Outputable library is used underneath, the work is done over SDoc -- types. -- -- The output provided by the library functions is identical to that of -- Prelude.show, except it has extra whitespace. -- -- For more info and examples of usage please see the README file and the -- API. @package GenericPretty @version 0.1.0 -- | GenericPretty is a haskell library that provides support for automatic -- derivation of pretty printing functions on user defined data types. -- The Outputable library is used underneath, the work is done over SDoc -- types. -- -- The output provided by the library functions is identical to that of -- Prelude.show, except it has extra whitespace. -- -- For examples of usage please see the README file. module Text.PrettyPrint.GenericPretty -- | pp is the default Pretty Printer, it uses a line length of 80 -- and 1.5 ribbons per line (= 53 non-whitespace chars per line) -- where ribbon is defined as the maximum length of text, excluding -- whitespace, on a single line pp :: Out a => a -> IO () -- | prettyP is a partly customizable Pretty Printer It takes the -- line length and ribbons per line as parameters prettyP :: Out a => Int -> Float -> a -> IO () -- | prettyStr returns the result as a string. The returned value is -- identical to one made by Prelude.show, except for the extra whitespace prettyStr :: Out a => a -> String -- | fullPP is a fully customizable Pretty Printer. fullPP :: Out a => a -> PprStyle -> Mode -> Int -> Float -> (TextDetails -> b -> b) -> b -> b -- | outputTxt transforms the text into strings and outputs it -- directly. This is one example of a function that can handle the text -- conversion for fullPP. outputTxt :: TextDetails -> IO () -> IO () -- | outputStr just leaves the text as a string. Another example of -- a function that can handle the text conversion for fullPP. outputStr :: TextDetails -> String -> String -- | Representable types of kind *. This class is derivable in GHC with the -- DeriveRepresentable flag on. class Generic a -- | The class Out is just a wrapper class for Outputable, which -- passes an extra parameter used to determine when to wrap types up in -- parentheses class Out a where out n x = sep $ out1 (from x) Pref n False outList n xs = brackets (fsep (punctuate comma (map (out n) xs))) out :: Out a => Int -> a -> SDoc outList :: Out a => Int -> [a] -> SDoc instance [overlap ok] (Out a, Out b, Out c, Out d, Out e, Out f, Out g, Out h, Out i, Out j, Out k, Out l, Out m, Out n, Out o) => Out (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) instance [overlap ok] (Out a, Out b, Out c, Out d, Out e, Out f, Out g, Out h, Out i, Out j, Out k, Out l, Out m, Out n) => Out (a, b, c, d, e, f, g, h, i, j, k, l, m, n) instance [overlap ok] (Out a, Out b, Out c, Out d, Out e, Out f, Out g, Out h, Out i, Out j, Out k, Out l, Out m) => Out (a, b, c, d, e, f, g, h, i, j, k, l, m) instance [overlap ok] (Out a, Out b, Out c, Out d, Out e, Out f, Out g, Out h, Out i, Out j, Out k, Out l) => Out (a, b, c, d, e, f, g, h, i, j, k, l) instance [overlap ok] (Out a, Out b, Out c, Out d, Out e, Out f, Out g, Out h, Out i, Out j, Out k) => Out (a, b, c, d, e, f, g, h, i, j, k) instance [overlap ok] (Out a, Out b, Out c, Out d, Out e, Out f, Out g, Out h, Out i, Out j) => Out (a, b, c, d, e, f, g, h, i, j) instance [overlap ok] (Out a, Out b, Out c, Out d, Out e, Out f, Out g, Out h, Out i) => Out (a, b, c, d, e, f, g, h, i) instance [overlap ok] (Out a, Out b, Out c, Out d, Out e, Out f, Out g, Out h) => Out (a, b, c, d, e, f, g, h) instance [overlap ok] (Out a, Out b, Out c, Out d, Out e, Out f, Out g) => Out (a, b, c, d, e, f, g) instance [overlap ok] (Out a, Out b, Out c, Out d, Out e, Out f) => Out (a, b, c, d, e, f) instance [overlap ok] (Out a, Out b, Out c, Out d, Out e) => Out (a, b, c, d, e) instance [overlap ok] (Out a, Out b, Out c, Out d) => Out (a, b, c, d) instance [overlap ok] (Out a, Out b, Out c) => Out (a, b, c) instance [overlap ok] (Out a, Out b) => Out (a, b) instance [overlap ok] (Out a, Out b) => Out (Either a b) instance [overlap ok] Out a => Out (Maybe a) instance [overlap ok] Out Int instance [overlap ok] Out Bool instance [overlap ok] Out a => Out [a] instance [overlap ok] Out Integer instance [overlap ok] Out Char instance [overlap ok] (GOut f, GOut g) => GOut (f :*: g) instance [overlap ok] (GOut f, GOut g) => GOut (f :+: g) instance [overlap ok] Out f => GOut (K1 t f) instance [overlap ok] (GOut f, Constructor c) => GOut (M1 C c f) instance [overlap ok] (GOut f, Selector c) => GOut (M1 S c f) instance [overlap ok] (GOut f, Datatype c) => GOut (M1 D c f) instance [overlap ok] GOut U1 instance [overlap ok] Out a => Outputable a instance [overlap ok] Outputable a => Out a