pire-0.2.5

Copyright(c) Andreas Reuleaux 2015 - 2018
LicenseBSD2
MaintainerAndreas Reuleaux <rx@a-rx.info>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe
LanguageHaskell2010

PrettyCommon

Description

pretty printing for Pire: common/basic functions, parts copied from Ermine and Pi-forall, adapted for Pire, Prettyprinter

Synopsis

Documentation

data Ann Source #

Constructors

Keyword

Used for syntactic keywords

Syntax

Syntax punctuation such as commas, parenthesis, and braces

Label

Record labels

Literal

Literals such as integers and strings

Builtin

Builtin types and values

Operator

Operators

TypeA 
Function 
DataA 
BoundV 

annToAnsiStyle :: Ann -> AnsiStyle Source #

Convert annotations to their corresponding color for syntax highlighting purposes

maybe Connor colors, cf http:/docs.idris-lang.orgenlatestreference/semantic-highlighting.html

Bound Variable Purple Magenta Keyword Bold Underlined Function Green Green Type Blue Blue Data Red Red Implicit Italic Purple Italic Magenta

class PrettyAnn a where Source #

Minimal complete definition

prettyAnn

Methods

prettyAnn :: a -> Doc Ann Source #

say :: Doc ann -> IO () Source #

sayLn :: Doc ann -> IO () Source #

Pretty print to stdout with a linebreak after.

pp :: Pretty a => a -> IO () Source #

"aka pretty print"

class Pretty2 a where Source #

Minimal complete definition

pretty2

Methods

pretty2 :: a -> Doc ann Source #

class PrettyAnn2 a where Source #

Minimal complete definition

prettyAnn2

Methods

prettyAnn2 :: a -> Doc Ann Source #

pp2 :: Pretty2 a => a -> IO () Source #

"aka pretty print"

qq :: PrettyAnn a => a -> IO () Source #

"aka color pretty print (pretty print ++)"

pps :: Pretty a => a -> String Source #