Copyright | (c) 2017 2018 N Steenbergen |
---|---|
License | GPL-3 |
Maintainer | ns@slak.ws |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
This module provides instances for prettyprinted output in Doc
-format.
- class Printable a where
- pretty :: Printable a => a -> Doc
- prettyEmbedded :: Printable a => a -> Doc
- prettyRecursive :: Printable a => a -> Doc
Documentation
class Printable a where Source #
Instances of this class can be prettyprinted.
Produce a Doc
representing LaTeX code.
prettyEmbedded :: a -> Doc Source #
In some cases, the representation for a type must be embellished with some other symbols when it occurs as part of a representation of a different type, but not when it occurs on its own. This printer allows us to specify this alternative.
prettyRecursive :: a -> Doc Source #
Prettyprinting below the top level can optionally have a different procedure - for adding parentheses, for example.
prettyEmbedded :: Printable a => a -> Doc Source #
In some cases, the representation for a type must be embellished with some other symbols when it occurs as part of a representation of a different type, but not when it occurs on its own. This printer allows us to specify this alternative.
prettyRecursive :: Printable a => a -> Doc Source #
Prettyprinting below the top level can optionally have a different procedure - for adding parentheses, for example.