Copyright | Brent Yorgey |
---|---|
License | BSD-3-Clause |
Maintainer | byorgey@gmail.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Pretty-printing for the Swarm language.
Synopsis
- class PrettyPrec a where
- prettyPrec :: Int -> a -> Doc ann
- ppr :: PrettyPrec a => a -> Doc ann
- prettyText :: PrettyPrec a => a -> Text
- prettyString :: PrettyPrec a => a -> String
- pparens :: Bool -> Doc ann -> Doc ann
- prettyTuple :: Term -> Doc a
- prettyPrecApp :: Int -> Term -> Term -> Doc a
- appliedTermPrec :: Term -> Int
Documentation
class PrettyPrec a where Source #
Type class for things that can be pretty-printed, given a precedence level of their context.
prettyPrec :: Int -> a -> Doc ann Source #
Instances
ppr :: PrettyPrec a => a -> Doc ann Source #
Pretty-print a thing, with a context precedence level of zero.
prettyText :: PrettyPrec a => a -> Text Source #
Pretty-print something and render it as Text
.
prettyString :: PrettyPrec a => a -> String Source #
Pretty-print something and render it as a String
.
pparens :: Bool -> Doc ann -> Doc ann Source #
Optionally surround a document with parentheses depending on the
Bool
argument.
prettyTuple :: Term -> Doc a Source #
appliedTermPrec :: Term -> Int Source #