Safe Haskell | None |
---|---|
Language | Haskell2010 |
Utilities for declaring and documenting entry points.
Synopsis
- data DEntryPoint (kind :: Type) = DEntryPoint {}
- data PlainEntryPointsKind
- diEntryPointToMarkdown :: HeaderLevel -> DEntryPoint level -> Markdown
- data DEntryPointArg = DEntryPointArg {
- epaArg :: Maybe DType
- epaBuilding :: [ParamBuildingStep]
- class DeriveCtorFieldDoc (cf :: CtorField) where
- data ParamBuildingStep = ParamBuildingStep {
- pbsEnglish :: Markdown
- pbsHaskell :: CurrentParam -> Markdown
- pbsMichelson :: CurrentParam -> Markdown
- clarifyParamBuildingSteps :: ParamBuildingStep -> (inp :-> out) -> inp :-> out
- mkDEntryPointArgSimple :: forall t. TypeHasDoc t => DEntryPointArg
- type DocumentEntryPoints kind a = (Generic a, GDocumentEntryPoints kind (Rep a))
- entryCase :: forall dt entryPointKind out inp clauses. (CaseTC dt out inp clauses, DocumentEntryPoints entryPointKind dt) => Proxy entryPointKind -> IsoRecTuple clauses -> (dt & inp) :-> out
- entryCase_ :: forall dt entryPointKind out inp. (InstrCaseC dt inp out, RMap (CaseClauses dt), DocumentEntryPoints entryPointKind dt) => Proxy entryPointKind -> Rec (CaseClauseL inp out) (CaseClauses dt) -> (dt & inp) :-> out
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.
Instances
data PlainEntryPointsKind Source #
Default value for DEntryPoint
type argument.
Instances
diEntryPointToMarkdown :: HeaderLevel -> DEntryPoint level -> Markdown Source #
Default implementation of docItemToMarkdown
for entry points.
data DEntryPointArg Source #
Describes argument of an entry point.
DEntryPointArg | |
|
Instances
DocItem DEntryPointArg Source # | |
Defined in Lorentz.EntryPoints.Doc type DocItemPosition DEntryPointArg = (pos :: Nat) Source # type DocItemPlacement DEntryPointArg :: DocItemPlacementKind Source # docItemSectionName :: Maybe Text Source # docItemSectionDescription :: Maybe Markdown Source # docItemSectionNameStyle :: DocSectionNameStyle Source # docItemRef :: DEntryPointArg -> DocItemRef (DocItemPlacement DEntryPointArg) Source # docItemToMarkdown :: HeaderLevel -> DEntryPointArg -> Markdown Source # docItemDependencies :: DEntryPointArg -> [SomeDocDefinitionItem] Source # docItemsOrder :: [DEntryPointArg] -> [DEntryPointArg] Source # | |
type DocItemPosition DEntryPointArg Source # | |
Defined in Lorentz.EntryPoints.Doc | |
type DocItemPlacement DEntryPointArg Source # | |
Defined in Lorentz.EntryPoints.Doc |
class DeriveCtorFieldDoc (cf :: CtorField) where Source #
Pick a type documentation from CtorField
.
Instances
DeriveCtorFieldDoc NoFields Source # | |
Defined in Lorentz.EntryPoints.Doc | |
TypeHasDoc ty => DeriveCtorFieldDoc (OneField ty) Source # | |
Defined in Lorentz.EntryPoints.Doc |
data ParamBuildingStep Source #
Describes a parameter building step.
This can be wrapping into (Haskell) constructor, or a more complex transformation.
ParamBuildingStep | |
|
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.
mkDEntryPointArgSimple :: forall t. TypeHasDoc t => DEntryPointArg Source #
type DocumentEntryPoints kind a = (Generic a, GDocumentEntryPoints kind (Rep a)) Source #
Constraint for documentEntryPoints
.
entryCase :: forall dt entryPointKind out inp clauses. (CaseTC dt out inp clauses, DocumentEntryPoints entryPointKind dt) => Proxy entryPointKind -> IsoRecTuple clauses -> (dt & inp) :-> out Source #
Version of entryCase_
for tuples.
entryCase_ :: forall dt entryPointKind out inp. (InstrCaseC dt inp out, RMap (CaseClauses dt), DocumentEntryPoints entryPointKind dt) => Proxy entryPointKind -> Rec (CaseClauseL inp out) (CaseClauses dt) -> (dt & inp) :-> out Source #
Like case_
, 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.