lorentz-0.16.0: EDSL for the Michelson Language
Safe HaskellSafe-Inferred
LanguageHaskell2010

Lorentz.Util.TH

Description

Lorentz template-haskell and quasiquote utilities.

Synopsis

Documentation

entrypointDoc :: QuasiQuoter Source #

QuasiQuote that helps generating ParameterHasEntrypoints instance.

Usage:

[entrypointDoc| Parameter <parameter-type> [<root-annotation>] |]
[entrypointDoc| Parameter plain |]
[entrypointDoc| Parameter plain "root"|]

See this tutorial which includes this quasiquote.

errorDocArg :: QuasiQuoter Source #

QuasiQuote that helps generating CustomErrorHasDoc instance.

Usage:

[errorDocArg| <error-name> <error-type> <error-description> [<error-arg-type>] |]
[errorDocArg| "errorName" exception "Error description" |]
[errorDocArg| "errorName" contract-internal "Error description" () |]
[errorDocArg| "errorName" bad-argument "Error description" Integer |]

The default argument type is NoErrorArg. Only a type name can be used, if you need complex type, define a type synonym.

See this tutorial which includes this quasiquote.

typeDoc :: QuasiQuoter Source #

QuasiQuote that helps generating TypeHasDoc instance.

Usage:

[typeDoc| <type> <description> [<field naming strategy>] |]
[typeDoc| Storage "This is storage description" |]
[typeDoc| Storage "This is storage description" stripFieldPrefix |]

field naming strategy is optional, and is a function with signature Text -> Text. Common strategies include id and stripFieldPrefix. If unspecified, ultimately defaults to id.

See this tutorial which includes this quasiquote.