morley-1.12.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

Instances details
RenderDoc AnnotationSet Source # 
Instance details

Defined in Michelson.Untyped.Annotation

RenderDoc T Source # 
Instance details

Defined in Michelson.Untyped.Type

RenderDoc ParameterType 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 TypeCheckedOp Source # 
Instance details

Defined in Michelson.TypeCheck.TypeCheckedOp

RenderDoc ParsedOp Source # 
Instance details

Defined in Michelson.Macro

RenderDoc (Prettier ParameterType) Source # 
Instance details

Defined in Michelson.Untyped.Type

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

RenderDoc (Notes t) Source # 
Instance details

Defined in Michelson.Typed.Annotation

RenderDoc (PackedNotes a) Source # 
Instance details

Defined in Michelson.Typed.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.

printTypedContractCode :: (SingI p, SingI s) => Bool -> ContractCode p s -> Text Source #

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

printTypedContract :: Bool -> Contract p s -> Text Source #

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

printSomeContract :: Bool -> SomeContract -> Text Source #

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

printTypedValue :: forall t. ProperPrintedValBetterErrors t => Bool -> Value t -> Text Source #

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

printUntypedValue :: RenderDoc op => Bool -> Value' op -> Text Source #

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