Module contracts

Contract implementation: compare a term against a contract.

Description

Contract implementation: compare a term against a contract.

See the function checkType/3 for assistance on checking if a term does/does not break a contract.

Function Index

checkEventIn/3
checkEventOut/3
checkRPCIn/3
checkRPCOut/4
checkType/3Given a contract type name, a term to check against that contract type, and a contract module name, verify the term against that contract's type.
isType/3
isTypeAttr/2

Function Details

checkEventIn/3

checkEventIn(Msg, ThisState, Mod) -> any()

checkEventOut/3

checkEventOut(Msg, ThisState, Mod) -> any()

checkRPCIn/3

checkRPCIn(Msg, State, Mod) -> any()

checkRPCOut/4

checkRPCOut(MsgOut, StateOut, FSM2, Mod) -> any()

checkType/3

checkType(HumanType::contract_type_name_atom(), Term::term(), Mod::contract_module_name_atom()) -> yup | error_hints_term_only_human_readable_sorry()

Given a contract type name, a term to check against that contract type, and a contract module name, verify the term against that contract's type.

Example usage from the irc_plugin.con contract: NOTE: This is a brute-force function, but it works, mostly. Don't try to have a computer parse the output in error cases: the failure output is meant only for human eyes.

isType/3

isType(Type, X, Mod) -> any()

isTypeAttr/2

isTypeAttr(X1, X2) -> any()


Generated EDoc, $Id$