morley-0.5.0: Developer tools for the Michelson Language

Safe HaskellNone
LanguageHaskell2010

Lorentz.EntryPoints.Doc

Description

Utilities for declaring and documenting entry points.

Synopsis

Documentation

data DEntryPoint (kind :: Type) Source #

Gathers information about single entry point.

We assume that entry points might be of different kinds, which is designated by phantom type parameter. For instance, you may want to have several groups of entry points corresponding to various parts of a contract - specifying different kind type argument for each of those groups will allow you defining different DocItem instances with appropriate custom descriptions for them.

Constructors

DEntryPoint Text SubDoc 

diEntryPointToMarkdown :: HeaderLevel -> DEntryPoint level -> Markdown Source #

Default implementation of docItemToMarkdown for entry points.

data DEntryPointArg Source #

Describes argument of an entry point.

Constructors

DEntryPointArg 

Fields

  • epaArg :: Maybe DType

    Argument of the entry point. Pass Nothing if no argument is required.

  • epaBuilding :: [ParamBuildingStep]

    Describes a way to lift an entry point argument into full parameter which can be passed to the contract.

    Steps are supposed to be applied in the order in which they are given. E.g. suppose that an entry point is called as Run (Service1 arg); then the first step should describe wrapping into Service1 constructor, and the second step should be about wrapping into Run constructor.

class DeriveCtorFieldDoc (cf :: CtorField) where Source #

Pick a type documentation from CtorField.

data ParamBuildingStep Source #

Describes a parameter building step.

This can be wrapping into (Haskell) constructor, or a more complex transformation.

Constructors

ParamBuildingStep 

Fields

clarifyParamBuildingSteps :: ParamBuildingStep -> (inp :-> out) -> inp :-> out Source #

Go over contract code and update every occurrence of DEntryPointArg documentation item, adding the given step to its "how to build parameter" description.

entryCase :: forall dt entryPointKind out inp clauses. (CaseTC dt out inp clauses, DocumentEntryPoints entryPointKind dt) => Proxy entryPointKind -> IsoRecTuple clauses -> (dt & inp) :-> out Source #

Like caseT, to be used for pattern-matching on parameter.

Modifies documentation accordingly. Including description of entrypoints' arguments, thus for them you will need to supply TypeHasDoc instance.