morley-1.0.0: Developer tools for the Michelson Language

Safe HaskellNone
LanguageHaskell2010

Michelson.Printer

Synopsis

Documentation

class RenderDoc a where Source #

Generalize converting a type into a Text.PrettyPrint.Leijen.Text.Doc. Used to pretty print Michelson code and define Fmt.Buildable instances.

Minimal complete definition

renderDoc

Methods

renderDoc :: RenderContext -> a -> Doc Source #

isRenderable :: a -> Bool Source #

Whether a value can be represented in Michelson code. Normally either all values of some type are renderable or not renderable. However, in case of instructions we have extra instructions which should not be rendered. Note: it's not suficcient to just return mempty for such instructions, because sometimes we want to print lists of instructions and we need to ignore them complete (to avoid putting redundant separators).

Instances
RenderDoc CT Source # 
Instance details

Defined in Michelson.Untyped.Type

RenderDoc T Source # 
Instance details

Defined in Michelson.Untyped.Type

RenderDoc Comparable Source # 
Instance details

Defined in Michelson.Untyped.Type

RenderDoc Type Source # 
Instance details

Defined in Michelson.Untyped.Type

RenderDoc ExpandedOp Source # 
Instance details

Defined in Michelson.Untyped.Instr

RenderDoc ParsedOp Source # 
Instance details

Defined in Michelson.Macro

RenderDoc (Prettier Type) Source # 
Instance details

Defined in Michelson.Untyped.Type

RenderDoc op => RenderDoc (ExtInstrAbstract op) Source # 
Instance details

Defined in Michelson.Untyped.Ext

RenderDoc op => RenderDoc (Contract' op) Source # 
Instance details

Defined in Michelson.Untyped.Contract

RenderDoc op => RenderDoc (Elt op) Source # 
Instance details

Defined in Michelson.Untyped.Value

RenderDoc op => RenderDoc (Value' op) Source # 
Instance details

Defined in Michelson.Untyped.Value

RenderDoc op => RenderDoc (InstrAbstract op) Source # 
Instance details

Defined in Michelson.Untyped.Instr

KnownAnnTag tag => RenderDoc (Annotation tag) Source # 
Instance details

Defined in Michelson.Untyped.Annotation

printDoc :: Bool -> Doc -> Text Source #

Convert Doc to Text with a line width of 80.

printUntypedContract :: RenderDoc op => Bool -> Contract' op -> Text Source #

Convert an untyped contract into a textual representation which will be accepted by the OCaml reference client.

printTypedContract :: (SingI p, SingI s) => Bool -> Contract p s -> Text Source #

Convert a typed contract into a textual representation which will be accepted by the OCaml reference client.