Safe Haskell | None |
---|---|
Language | Haskell2010 |
Michelson contract in untyped model.
Synopsis
- data EntriesOrder
- canonicalEntriesOrder :: EntriesOrder
- entriesOrderToInt :: EntriesOrder -> (Int, Int, Int)
- mapEntriesOrdered :: Contract' op -> (ParameterType -> a) -> (Storage -> a) -> ([op] -> a) -> [a]
- data ContractBlock op
- = CBParam ParameterType
- | CBStorage Ty
- | CBCode [op]
- orderContractBlock :: (ContractBlock op, ContractBlock op, ContractBlock op) -> Maybe (Contract' op)
- data Contract' op = Contract {}
- type Storage = Ty
Documentation
data EntriesOrder Source #
Top-level entries order of the contract. This is preserved due to the fact that it affects the output of pretty-printing and serializing contract.
Instances
canonicalEntriesOrder :: EntriesOrder Source #
The canonical entries order which is ordered as follow:
parameter
, storage
, and code
.
entriesOrderToInt :: EntriesOrder -> (Int, Int, Int) Source #
(Int, Int, Int)
is the positions of parameter
, storage
, and code
respectively.
mapEntriesOrdered :: Contract' op -> (ParameterType -> a) -> (Storage -> a) -> ([op] -> a) -> [a] Source #
Map each contract fields by the given function and sort the output
based on the EntriesOrder
.
data ContractBlock op Source #
Contract block, convenient when parsing
Instances
Eq op => Eq (ContractBlock op) Source # | |
Defined in Morley.Michelson.Untyped.Contract (==) :: ContractBlock op -> ContractBlock op -> Bool # (/=) :: ContractBlock op -> ContractBlock op -> Bool # | |
Show op => Show (ContractBlock op) Source # | |
Defined in Morley.Michelson.Untyped.Contract showsPrec :: Int -> ContractBlock op -> ShowS # show :: ContractBlock op -> String # showList :: [ContractBlock op] -> ShowS # |
orderContractBlock :: (ContractBlock op, ContractBlock op, ContractBlock op) -> Maybe (Contract' op) Source #
Construct a contract representation from three different contract blocks (i.e. parameters, storage and code blocks) in arbitrary order. This saves the order in the contract so that it can print the contract blocks in the same order it was parsed.
General untyped contract representation.
Contract | |
|