Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class RenderDoc a where
- renderDoc :: RenderContext -> a -> Doc
- isRenderable :: a -> Bool
- printDoc :: Bool -> Doc -> Text
- printUntypedContract :: RenderDoc op => Bool -> Contract' op -> Text
- printTypedContractCode :: (SingI p, SingI s) => Bool -> ContractCode p s -> Text
- printTypedContract :: Bool -> Contract p s -> Text
- printSomeContract :: Bool -> SomeContract -> Text
- printTypedValue :: forall t. ProperPrintedValBetterErrors t => Bool -> Value t -> Text
- printUntypedValue :: RenderDoc op => Bool -> Value' op -> Text
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.
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
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.