sifflet-lib-1.0: Library of modules shared by sifflet and its tests and its exporters.Source codeContentsIndex
Sifflet.Text.Pretty
Synopsis
class Pretty a where
pretty :: a -> String
prettyList :: String -> String -> String -> [a] -> String
indentLine :: Int -> String -> String
sepLines :: [String] -> String
sepLines2 :: [String] -> String
sepComma :: [String] -> String
sepCommaSp :: [String] -> String
Documentation
class Pretty a whereSource

The class of types that can be pretty-printed. pretty x is a pretty String representation of x. prettyList prefix infix postfix xs is a pretty String representation of the list xs, with prefix, infix, and postfix specifying the punctuation. For example, if (pretty x) => x, then prettyList [ , ] [x, x, x] => [x, x, x].

Minimal complete implementation: define pretty.

Methods
pretty :: a -> StringSource
prettyList :: String -> String -> String -> [a] -> StringSource
show/hide Instances
indentLine :: Int -> String -> StringSource
Indent a single line n spaces.
sepLines :: [String] -> StringSource
sepLines is like unlines, but omits the n at the end of the last line.
sepLines2 :: [String] -> StringSource
sepLines2 is like sepLines, but adds an extra n between each pair of lines so they are double spaced.
sepComma :: [String] -> StringSource
Separate strings by commas and nothing else (,)
sepCommaSp :: [String] -> StringSource
Separate strings by commas and spaces (, )
Produced by Haddock version 2.6.1