sslang-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Common.Pretty

Description

Helpers for pretty-printing sslang, including common ASCII tokens.

Synopsis

Documentation

typeAnn :: Dumpy t => t -> Doc ann -> Doc ann Source #

typeAnn t d annotates document d with type annotation t.

Only used by spaghetti so constrained by Dumpy instead of Pretty for now.

drarrow :: Doc ann Source #

=>

larrow :: Doc ann Source #

<-

rarrow :: Doc ann Source #

->

dbar :: Doc ann Source #

||

bar :: Doc ann Source #

|

amp :: Doc ann Source #

&

block :: Doc ann -> [Doc ann] -> Doc ann Source #

Constructs a separator-delimited block Doc out of a list of Docs.

indentNo :: Int Source #

Number of spaces to indent

spaghetti :: Dumpy t => t -> String Source #

Format with a document of infinite width, preventing wraparound.

class Dumpy a where Source #

Dumpy Typeclass: print an ugly but parseable representation of the AST

  • Translates from IR to Doc representation in one-to-one fashion
  • No simplifications
  • No whitespace formatting
  • Type annotates everything

Methods

dumpy :: a -> Doc ann Source #

Instances

Instances details
Dumpy Program Source # 
Instance details

Defined in Front.Ast

Methods

dumpy :: Program -> Doc ann Source #

Dumpy Annotations Source # 
Instance details

Defined in IR.Types.Type

Methods

dumpy :: Annotations -> Doc ann Source #

Dumpy Annotation Source # 
Instance details

Defined in IR.Types.Type

Methods

dumpy :: Annotation -> Doc ann Source #

Dumpy Scheme Source # 
Instance details

Defined in IR.Types.Type

Methods

dumpy :: Scheme -> Doc ann Source #

Dumpy Type Source # 
Instance details

Defined in IR.Types.Type

Methods

dumpy :: Type -> Doc ann Source #