Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class Preview a where
- preview :: Preview a => a -> String
- previewNamedSet :: String -> t -> Set a -> String -> String
- previewNamedList :: String -> t -> [a] -> String -> String
- previewList :: Preview a => Int -> [a] -> String -> String
- previews :: Preview a => a -> String -> String
- previewRec :: Int -> String -> [(String, Int -> String -> String)] -> String -> String
- previewRec' :: Int -> String -> [String -> String] -> String -> String
- previewKv :: Preview a => String -> a -> String -> String
- showKv :: Show a => String -> a -> String -> String
- previewElems :: (Foldable t, Preview a) => t a -> String
- previewsElems :: (Foldable f, Preview a) => Int -> f a -> String -> String
- pprMapping :: (Ppr a, Ppr b) => [(a, b)] -> Doc
- previewList' :: Preview a => Maybe Int -> Int -> [a] -> String -> String
- previewsPrecMapping :: (Preview k, Preview v) => t -> [(k, v)] -> String -> String
- class Ppr a where
- class Ppr' k where
- data Doc :: *
- pretty :: Ppr a => a -> String
- prettyText :: Ppr a => a -> Text
- docFromStr :: String -> Doc
- shortPreviewStr :: Int -> String -> String
- docFromText :: Text -> Doc
- angles :: Doc -> Doc
Documentation
class Preview a where Source #
Conversion of values to short readable strings. Preview allows defining short and readable representations of potentially huge data structures that can be used in logs for example. E.g. the Preview instance for lists may only print the values at the beginning of the list and omit the rest.
previewsPrec :: Int -> a -> String -> String Source #
Create a preview String for the given value.
previewsPrec
should satisfy the law
previewsPrec d x r ++ s == previewsPrec d x (r ++ s)
Preview Bool Source # | |
Preview Char Source # | |
Preview Int Source # | |
Preview Int32 Source # | |
Preview Int64 Source # | |
Preview Word8 Source # | |
Preview Word64 Source # | |
Preview () Source # | |
Preview Text Source # | |
Preview a => Preview [a] Source # | |
Preview a => Preview (Maybe a) Source # | |
Preview a => Preview (Option a) Source # | |
Preview a => Preview (Fail a) Source # | |
Preview a => Preview (StrictList a) Source # | |
(Preview a, Preview b) => Preview (Either a b) Source # | |
(Preview a, Preview b) => Preview (a, b) Source # | |
(Preview k, Preview v) => Preview (Map k v) Source # | |
(Preview a, Preview b) => Preview (Pair a b) Source # | |
(Preview a, Preview b) => Preview (Choice a b) Source # | |
(Preview k, Preview v) => Preview (OSMap k v) Source # | |
(Preview a, Preview b, Preview c) => Preview (a, b, c) Source # | |
Ppr Bool Source # | |
Ppr Char Source # | |
Ppr Double Source # | |
Ppr Int Source # | |
Ppr Int32 Source # | |
Ppr Int64 Source # | |
Ppr Integer Source # | |
Ppr Word8 Source # | |
Ppr Word64 Source # | |
Ppr () Source # | |
Ppr Text Source # | |
Ppr Doc Source # | |
Ppr a => Ppr [a] Source # | |
Ppr a => Ppr (Maybe a) Source # | |
Ppr a => Ppr (Set a) Source # | |
Ppr a => Ppr (Option a) Source # | |
Ppr a => Ppr (Fail a) Source # | |
Ppr a => Ppr (StrictList a) Source # | |
(Ppr a, Ppr b) => Ppr (a, b) Source # | |
(Ppr a, Ppr b) => Ppr (Map a b) Source # | |
(Ppr a, Ppr b) => Ppr (Pair a b) Source # | |
(Ppr a, Ppr b) => Ppr (Choice a b) Source # | |
(Ppr k, Ppr v) => Ppr (OSMap k v) Source # | |
(Ppr k, Ppr v) => Ppr (USMap k v) Source # | |
The abstract type of documents. A Doc represents a set of layouts. A Doc with no occurrences of Union or NoDoc represents just one layout.
prettyText :: Ppr a => a -> Text Source #
docFromStr :: String -> Doc Source #
docFromText :: Text -> Doc Source #