pretty-display-0.1.10: Typeclass for human-readable display

Copyright(C) 2016 Justin Sermeno
LicenseBSD3
MaintainerJustin Sermeno
Safe HaskellSafe
LanguageHaskell2010

Text.Display

Contents

Description

An instance Display is similar to an instance of Show. The difference is that -- Show is meant to return well-formed haskell expressions and a complementary Read instance should be possible. Display is meant for human-readable output. For instance, you could have a complex data structure output a chart by default in GHCi, while still being able to derive an instance of Show to inspect the data structure when needed.

Synopsis

Types

class Display a where Source #

Minimal complete definition

display

Methods

display :: a -> DisplayText Source #

Instances

Show a => Display a Source # 

Methods

display :: a -> DisplayText Source #

Converting to the DisplayText type

mkDt :: Text -> DisplayText Source #

Alias for mkDt

Rendering the Display class

dShow :: Display a => a -> Text Source #

Convert Display instance into Text.

dPrint :: Display a => a -> IO () Source #

Print Display instance.

Re-exports

ppShow :: Show a => a -> String #

Convert a generic value into a pretty String, if possible.

pPrint :: Show a => a -> IO () Source #

Pretty print Show instance.