Safe Haskell | None |
---|---|
Language | Haskell2010 |
Pretty printer for types and terms.
Synopsis
- type PrettyVar a = (Pretty a, PrintCons a, IsVar a)
- data FixityCtx var a = FixityCtx {
- fixity'context :: var -> Maybe OpFix
- fixity'data :: a
- class PrintCons v where
- data OpFix = OpFix {
- opFix'fixity :: !Fixity
- opFix'prec :: !Int
- data Fixity
- class Pretty a where
- pretty :: a -> Doc ann
- prettyList :: [a] -> Doc ann
Documentation
Type to querry fixity of infix operations in type variables.
FixityCtx | |
|
class PrintCons v where Source #
This class is useful to define the way to print special cases like constructors for tuples or lists.
Defines fixity type and order of infix operation
OpFix | |
|
Infix operation can be left or right associative or associativity is not known.
>>>
pretty 1 <+> pretty "hello" <+> pretty 1.234
1 hello 1.234
prettyList :: [a] -> Doc ann #
is only used to define the prettyList
instance
. In normal circumstances only the Pretty
a => Pretty
[a]
function is used.pretty
>>>
prettyList [1, 23, 456]
[1, 23, 456]
Instances
Pretty Bool |
|
Defined in Prettyprinter.Internal | |
Pretty Char | Instead of
|
Defined in Prettyprinter.Internal | |
Pretty Double |
|
Defined in Prettyprinter.Internal | |
Pretty Float |
|
Defined in Prettyprinter.Internal | |
Pretty Int |
|
Defined in Prettyprinter.Internal | |
Pretty Int8 | |
Defined in Prettyprinter.Internal | |
Pretty Int16 | |
Defined in Prettyprinter.Internal | |
Pretty Int32 | |
Defined in Prettyprinter.Internal | |
Pretty Int64 | |
Defined in Prettyprinter.Internal | |
Pretty Integer |
|
Defined in Prettyprinter.Internal | |
Pretty Natural | |
Defined in Prettyprinter.Internal | |
Pretty Word | |
Defined in Prettyprinter.Internal | |
Pretty Word8 | |
Defined in Prettyprinter.Internal | |
Pretty Word16 | |
Defined in Prettyprinter.Internal | |
Pretty Word32 | |
Defined in Prettyprinter.Internal | |
Pretty Word64 | |
Defined in Prettyprinter.Internal | |
Pretty () |
The argument is not used,
|
Defined in Prettyprinter.Internal | |
Pretty Void | Finding a good example for printing something that does not exist is hard, so here is an example of printing a list full of nothing.
|
Defined in Prettyprinter.Internal | |
Pretty Text | (lazy |
Defined in Prettyprinter.Internal | |
Pretty Text | Automatically converts all newlines to
Note that
Manually use |
Defined in Prettyprinter.Internal | |
Pretty a => Pretty [a] |
|
Defined in Prettyprinter.Internal | |
Pretty a => Pretty (Maybe a) | Ignore
|
Defined in Prettyprinter.Internal | |
Pretty a => Pretty (Identity a) |
|
Defined in Prettyprinter.Internal | |
Pretty a => Pretty (NonEmpty a) | |
Defined in Prettyprinter.Internal | |
(Pretty a1, Pretty a2) => Pretty (a1, a2) |
|
Defined in Prettyprinter.Internal | |
PrettyVar v => Pretty (Type loc v) Source # | |
Defined in Type.Check.HM.Pretty | |
PrettyVar v => Pretty (Signature loc v) Source # | |
Defined in Type.Check.HM.Pretty | |
(Pretty loc, PrettyVar var) => Pretty (TypeError loc var) Source # | |
Defined in Type.Check.HM.Pretty | |
(Pretty loc, PrettyVar var) => Pretty (FixityCtx var (TypeError loc var)) Source # | |
(PrettyVar v, Pretty prim) => Pretty (FixityCtx v (Term prim loc v)) Source # | |
PrettyVar v => Pretty (FixityCtx v (Type loc v)) Source # | |
PrettyVar v => Pretty (FixityCtx v (Signature loc v)) Source # | |
(Pretty a1, Pretty a2, Pretty a3) => Pretty (a1, a2, a3) |
|
Defined in Prettyprinter.Internal | |
Pretty a => Pretty (Const a b) | |
Defined in Prettyprinter.Internal | |
(PrettyVar v, Pretty prim) => Pretty (Term prim loc v) Source # | |
Defined in Type.Check.HM.Pretty |