shimmer-0.1.3.2: The Reflective Lambda Machine

Safe HaskellSafe
LanguageHaskell98

SMR.Source.Pretty

Synopsis

Documentation

class Build a where Source #

Class of things that can be converted to text builders.

Minimal complete definition

build

Methods

build :: a -> Builder Source #

Instances

Build Text Source # 

Methods

build :: Text -> Builder Source #

Build Prim Source # 

Methods

build :: Prim -> Builder Source #

(Build s, Build p) => Build (Ref s p) Source # 

Methods

build :: Ref s p -> Builder Source #

(Build s, Build p) => Build (Exp s p) Source # 

Methods

build :: Exp s p -> Builder Source #

(Build s, Build p) => Build (Decl s p) Source # 

Methods

build :: Decl s p -> Builder Source #

data Ctx Source #

Context we're currently in when pretty printing.

Constructors

CtxTop

Top level context.

CtxFun

Functional expression in an an application.

CtxArg

Argument expression in an application.

Instances

Show Ctx Source # 

Methods

showsPrec :: Int -> Ctx -> ShowS #

show :: Ctx -> String #

showList :: [Ctx] -> ShowS #

parens :: Builder -> Builder Source #

Wrap a thing in parenthesis.

pretty :: Build a => a -> Text Source #

Pretty print a thing as strict Text.

buildDecl :: (Build s, Build p) => Decl s p -> Builder Source #

Yield a builder for a declaration.

buildExp :: (Build s, Build p) => Ctx -> Exp s p -> Builder Source #

Yield a builder for an expression.

buildParam :: Param -> Builder Source #

Yield a builder for a parameter.

buildKey :: Key -> Builder Source #

Yield a builder for a keyword.

buildTrain :: (Build s, Build p) => Train s p -> Builder Source #

Yield a builder for a train.

buildCar :: (Build s, Build p) => Car s p -> Builder Source #

Yield a builder for a train car.

buildSnv :: (Build s, Build p) => Snv s p -> Builder Source #

Yield a builder for a substitution.

buildSnvBind :: (Build s, Build p) => SnvBind s p -> Builder Source #

Yield a builder for a substitution binding.

buildUps :: Ups -> Builder Source #

Yield a builder for an ups.

buildUpsBump :: UpsBump -> Builder Source #

Yield a builder for an ups bump.

buildRef :: (Build s, Build p) => Ref s p -> Builder Source #

Yield a builder for a reference.

buildText :: Text -> Builder Source #

Build a text string, escaping special chars in JSON style.

buildPrim :: Prim -> Builder Source #

Yield a builder for a primitive.