morley-1.7.0: Developer tools for the Michelson Language
Safe HaskellNone
LanguageHaskell2010

Michelson.Typed.Doc

Description

Extracting documentation from instructions set.

Synopsis

Documentation

buildInstrDoc :: Instr inp out -> ContractDoc Source #

Assemble contract documentation.

buildInstrDocWithGitRev :: DGitRevision -> Instr inp out -> ContractDoc Source #

Assemble contract documentation with the revision of the contract.

modifyInstrDoc :: (DocItem i1, DocItem i2) => (i1 -> Maybe i2) -> Instr inp out -> Instr inp out Source #

Recursevly traverse an instruction and modify documentation items matching given type.

If mapper returns Nothing, doc item will remain unmodified.

modifyInstrAllDoc :: (SomeDocItem -> SomeDocItem) -> Instr inp out -> Instr inp out Source #

Modify all documentation items recursively.

cutInstrNonDoc :: (forall i o. Instr i o -> Instr i o) -> Instr inp out -> Instr s s Source #

Leave only instructions related to documentation.

Generated documentation for resulting instruction remains the same, but semantics of instruction itself gets lost. We have to pass optimizer here as an argument to avoid cyclic dependencies.

docInstr :: DocItem di => di -> Instr s s Source #

Put a document item.