swarm-0.1.0.0: 2D resource gathering game with programmable robots
CopyrightBrent Yorgey
LicenseBSD-3-Clause
Maintainerbyorgey@gmail.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Swarm.Language.Pretty

Description

Pretty-printing for the Swarm language.

Synopsis

Documentation

class PrettyPrec a where Source #

Type class for things that can be pretty-printed, given a precedence level of their context.

Methods

prettyPrec :: Int -> a -> Doc ann Source #

Instances

Instances details
PrettyPrec Capability Source # 
Instance details

Defined in Swarm.Language.Pretty

Methods

prettyPrec :: Int -> Capability -> Doc ann Source #

PrettyPrec Const Source # 
Instance details

Defined in Swarm.Language.Pretty

Methods

prettyPrec :: Int -> Const -> Doc ann Source #

PrettyPrec Direction Source # 
Instance details

Defined in Swarm.Language.Pretty

Methods

prettyPrec :: Int -> Direction -> Doc ann Source #

PrettyPrec Term Source # 
Instance details

Defined in Swarm.Language.Pretty

Methods

prettyPrec :: Int -> Term -> Doc ann Source #

PrettyPrec InvalidAtomicReason Source # 
Instance details

Defined in Swarm.Language.Pretty

PrettyPrec TypeErr Source # 
Instance details

Defined in Swarm.Language.Pretty

Methods

prettyPrec :: Int -> TypeErr -> Doc ann Source #

PrettyPrec BaseTy Source # 
Instance details

Defined in Swarm.Language.Pretty

Methods

prettyPrec :: Int -> BaseTy -> Doc ann Source #

PrettyPrec Polytype Source # 
Instance details

Defined in Swarm.Language.Pretty

Methods

prettyPrec :: Int -> Polytype -> Doc ann Source #

PrettyPrec UPolytype Source # 
Instance details

Defined in Swarm.Language.Pretty

Methods

prettyPrec :: Int -> UPolytype -> Doc ann Source #

PrettyPrec IntVar Source # 
Instance details

Defined in Swarm.Language.Pretty

Methods

prettyPrec :: Int -> IntVar -> Doc ann Source #

PrettyPrec t => PrettyPrec (Ctx t) Source # 
Instance details

Defined in Swarm.Language.Pretty

Methods

prettyPrec :: Int -> Ctx t -> Doc ann Source #

PrettyPrec t => PrettyPrec (TypeF t) Source # 
Instance details

Defined in Swarm.Language.Pretty

Methods

prettyPrec :: Int -> TypeF t -> Doc ann Source #

PrettyPrec (t (Fix t)) => PrettyPrec (Fix t) Source # 
Instance details

Defined in Swarm.Language.Pretty

Methods

prettyPrec :: Int -> Fix t -> Doc ann Source #

(PrettyPrec (t (UTerm t v)), PrettyPrec v) => PrettyPrec (UTerm t v) Source # 
Instance details

Defined in Swarm.Language.Pretty

Methods

prettyPrec :: Int -> UTerm t v -> Doc ann Source #

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.