| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Michelson.Untyped
Contents
Synopsis
- data Value op
- = ValueInt Integer
- | ValueString Text
- | ValueBytes InternalByteString
- | ValueUnit
- | ValueTrue
- | ValueFalse
- | ValuePair (Value op) (Value op)
- | ValueLeft (Value op)
- | ValueRight (Value op)
- | ValueSome (Value op)
- | ValueNone
- | ValueNil
- | ValueSeq (NonEmpty $ Value op)
- | ValueMap (NonEmpty $ Elt op)
- | ValueLambda (NonEmpty op)
- data Elt op = Elt (Value op) (Value op)
- newtype InternalByteString = InternalByteString ByteString
- unInternalByteString :: InternalByteString -> ByteString
- data Type = Type T TypeAnn
- data Comparable = Comparable CT TypeAnn
- compToType :: Comparable -> Type
- typeToComp :: Type -> Maybe Comparable
- data T
- data CT
- type family ToCT a :: CT where ...
- pattern Tint :: T
- pattern Tnat :: T
- pattern Tstring :: T
- pattern Tbytes :: T
- pattern Tmutez :: T
- pattern Tbool :: T
- pattern Tkey_hash :: T
- pattern Ttimestamp :: T
- pattern Taddress :: T
- tint :: T
- tnat :: T
- tstring :: T
- tbytes :: T
- tmutez :: T
- tbool :: T
- tkeyHash :: T
- ttimestamp :: T
- taddress :: T
- isAtomicType :: Type -> Bool
- isKey :: Type -> Bool
- isSignature :: Type -> Bool
- isComparable :: Type -> Bool
- isMutez :: Type -> Bool
- isKeyHash :: Type -> Bool
- isBool :: Type -> Bool
- isString :: Type -> Bool
- isInteger :: Type -> Bool
- isTimestamp :: Type -> Bool
- isNat :: Type -> Bool
- isInt :: Type -> Bool
- isBytes :: Type -> Bool
- data InstrAbstract op
- = EXT (ExtU InstrAbstract op)
- | DROP
- | DUP VarAnn
- | SWAP
- | PUSH VarAnn Type (Value op)
- | SOME TypeAnn VarAnn FieldAnn
- | NONE TypeAnn VarAnn FieldAnn Type
- | UNIT TypeAnn VarAnn
- | IF_NONE [op] [op]
- | PAIR TypeAnn VarAnn FieldAnn FieldAnn
- | CAR VarAnn FieldAnn
- | CDR VarAnn FieldAnn
- | LEFT TypeAnn VarAnn FieldAnn FieldAnn Type
- | RIGHT TypeAnn VarAnn FieldAnn FieldAnn Type
- | IF_LEFT [op] [op]
- | IF_RIGHT [op] [op]
- | NIL TypeAnn VarAnn Type
- | CONS VarAnn
- | IF_CONS [op] [op]
- | SIZE VarAnn
- | EMPTY_SET TypeAnn VarAnn Comparable
- | EMPTY_MAP TypeAnn VarAnn Comparable Type
- | MAP VarAnn [op]
- | ITER [op]
- | MEM VarAnn
- | GET VarAnn
- | UPDATE
- | IF [op] [op]
- | LOOP [op]
- | LOOP_LEFT [op]
- | LAMBDA VarAnn Type Type [op]
- | EXEC VarAnn
- | DIP [op]
- | FAILWITH
- | CAST VarAnn Type
- | RENAME VarAnn
- | PACK VarAnn
- | UNPACK VarAnn Type
- | CONCAT VarAnn
- | SLICE VarAnn
- | ISNAT VarAnn
- | ADD VarAnn
- | SUB VarAnn
- | MUL VarAnn
- | EDIV VarAnn
- | ABS VarAnn
- | NEG
- | LSL VarAnn
- | LSR VarAnn
- | OR VarAnn
- | AND VarAnn
- | XOR VarAnn
- | NOT VarAnn
- | COMPARE VarAnn
- | EQ VarAnn
- | NEQ VarAnn
- | LT VarAnn
- | GT VarAnn
- | LE VarAnn
- | GE VarAnn
- | INT VarAnn
- | SELF VarAnn
- | CONTRACT VarAnn Type
- | TRANSFER_TOKENS VarAnn
- | SET_DELEGATE VarAnn
- | CREATE_ACCOUNT VarAnn VarAnn
- | CREATE_CONTRACT VarAnn VarAnn
- | CREATE_CONTRACT2 VarAnn VarAnn (Contract op)
- | IMPLICIT_ACCOUNT VarAnn
- | NOW VarAnn
- | AMOUNT VarAnn
- | BALANCE VarAnn
- | CHECK_SIGNATURE VarAnn
- | SHA256 VarAnn
- | SHA512 VarAnn
- | BLAKE2B VarAnn
- | HASH_KEY VarAnn
- | STEPS_TO_QUOTA VarAnn
- | SOURCE VarAnn
- | SENDER VarAnn
- | ADDRESS VarAnn
- newtype Op = Op {}
- type Instr = InstrAbstract Op
- data ExpandedOp
- type ExpandedInstr = InstrAbstract ExpandedOp
- type family ExtU (instr :: Type -> Type) :: Type -> Type
- type InstrExtU = ExtU InstrAbstract Op
- type ExpandedInstrExtU = ExtU InstrAbstract ExpandedOp
- data OriginationOperation = OriginationOperation {
- ooManager :: !KeyHash
- ooDelegate :: !(Maybe KeyHash)
- ooSpendable :: !Bool
- ooDelegatable :: !Bool
- ooBalance :: !Mutez
- ooStorage :: !(Value ExpandedOp)
- ooContract :: !(Contract ExpandedOp)
- mkContractAddress :: ToJSON ExpandedInstrExtU => OriginationOperation -> Address
- type Parameter = Type
- type Storage = Type
- data Contract op = Contract {}
- newtype Annotation tag = Annotation Text
- pattern WithAnn :: Annotation tag -> Annotation tag
- type TypeAnn = Annotation TypeTag
- type FieldAnn = Annotation FieldTag
- type VarAnn = Annotation VarTag
- noAnn :: Annotation a
- ann :: Text -> Annotation a
- unifyAnn :: Annotation tag -> Annotation tag -> Maybe (Annotation tag)
- ifAnnUnified :: Annotation tag -> Annotation tag -> Bool
- disjoinVn :: VarAnn -> (VarAnn, VarAnn)
- convAnn :: Annotation tag1 -> Annotation tag2
- type UntypedContract = Contract ExpandedOp
- type UntypedValue = Value ExpandedOp
Documentation
Constructors
| ValueInt Integer | |
| ValueString Text | |
| ValueBytes InternalByteString | |
| ValueUnit | |
| ValueTrue | |
| ValueFalse | |
| ValuePair (Value op) (Value op) | |
| ValueLeft (Value op) | |
| ValueRight (Value op) | |
| ValueSome (Value op) | |
| ValueNone | |
| ValueNil | |
| ValueSeq (NonEmpty $ Value op) | A sequence of elements: can be a list or a set. We can't distinguish lists and sets during parsing. |
| ValueMap (NonEmpty $ Elt op) | |
| ValueLambda (NonEmpty op) |
Instances
Instances
| Functor Elt Source # | |
| Eq op => Eq (Elt op) Source # | |
| Data op => Data (Elt op) Source # | |
Defined in Michelson.Untyped.Value Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Elt op -> c (Elt op) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Elt op) # toConstr :: Elt op -> Constr # dataTypeOf :: Elt op -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Elt op)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Elt op)) # gmapT :: (forall b. Data b => b -> b) -> Elt op -> Elt op # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Elt op -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Elt op -> r # gmapQ :: (forall d. Data d => d -> u) -> Elt op -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Elt op -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Elt op -> m (Elt op) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Elt op -> m (Elt op) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Elt op -> m (Elt op) # | |
| Show op => Show (Elt op) Source # | |
| Generic (Elt op) Source # | |
| ToJSON op => ToJSON (Elt op) Source # | |
Defined in Michelson.Untyped.Value | |
| FromJSON op => FromJSON (Elt op) Source # | |
| RenderDoc op => Buildable (Elt op) Source # | |
Defined in Michelson.Untyped.Value | |
| RenderDoc op => RenderDoc (Elt op) Source # | |
| type Rep (Elt op) Source # | |
Defined in Michelson.Untyped.Value type Rep (Elt op) = D1 (MetaData "Elt" "Michelson.Untyped.Value" "morley-0.2.0-DKAk4nHfsQHKu9FVdoO5vJ" False) (C1 (MetaCons "Elt" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Value op)) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Value op)))) | |
newtype InternalByteString Source #
ByteString does not have an instance for ToJSON and FromJSON, to avoid orphan type class instances, make a new type wrapper around it.
Constructors
| InternalByteString ByteString |
Instances
Instances
| Eq Type Source # | |
| Data Type Source # | |
Defined in Michelson.Untyped.Type Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Type -> c Type # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Type # dataTypeOf :: Type -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Type) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Type) # gmapT :: (forall b. Data b => b -> b) -> Type -> Type # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Type -> r # gmapQ :: (forall d. Data d => d -> u) -> Type -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Type -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Type -> m Type # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Type -> m Type # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Type -> m Type # | |
| Show Type Source # | |
| Generic Type Source # | |
| ToJSON Type Source # | |
Defined in Michelson.Untyped.Type | |
| FromJSON Type Source # | |
| Buildable Type Source # | |
Defined in Michelson.Untyped.Type | |
| RenderDoc Type Source # | |
| type Rep Type Source # | |
Defined in Michelson.Untyped.Type type Rep Type = D1 (MetaData "Type" "Michelson.Untyped.Type" "morley-0.2.0-DKAk4nHfsQHKu9FVdoO5vJ" False) (C1 (MetaCons "Type" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 T) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 TypeAnn))) | |
data Comparable Source #
Constructors
| Comparable CT TypeAnn |
Instances
compToType :: Comparable -> Type Source #
typeToComp :: Type -> Maybe Comparable Source #
Constructors
Instances
Instances
| Bounded CT Source # | |
| Enum CT Source # | |
| Eq CT Source # | |
| Data CT Source # | |
Defined in Michelson.Untyped.Type Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CT -> c CT # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CT # dataTypeOf :: CT -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CT) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CT) # gmapT :: (forall b. Data b => b -> b) -> CT -> CT # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CT -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CT -> r # gmapQ :: (forall d. Data d => d -> u) -> CT -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> CT -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CT -> m CT # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CT -> m CT # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CT -> m CT # | |
| Ord CT Source # | |
| Show CT Source # | |
| Generic CT Source # | |
| ToJSON CT Source # | |
Defined in Michelson.Untyped.Type | |
| FromJSON CT Source # | |
| Buildable CT Source # | |
Defined in Michelson.Untyped.Type | |
| RenderDoc CT Source # | |
| SingI CInt Source # | |
Defined in Michelson.Typed.Sing | |
| SingI CNat Source # | |
Defined in Michelson.Typed.Sing | |
| SingI CString Source # | |
Defined in Michelson.Typed.Sing | |
| SingI CBytes Source # | |
Defined in Michelson.Typed.Sing | |
| SingI CMutez Source # | |
Defined in Michelson.Typed.Sing | |
| SingI CBool Source # | |
Defined in Michelson.Typed.Sing | |
| SingI CKeyHash Source # | |
Defined in Michelson.Typed.Sing | |
| SingI CTimestamp Source # | |
Defined in Michelson.Typed.Sing Methods sing :: Sing CTimestamp # | |
| SingI CAddress Source # | |
Defined in Michelson.Typed.Sing | |
| type Rep CT Source # | |
Defined in Michelson.Untyped.Type type Rep CT = D1 (MetaData "CT" "Michelson.Untyped.Type" "morley-0.2.0-DKAk4nHfsQHKu9FVdoO5vJ" False) (((C1 (MetaCons "CInt" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "CNat" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "CString" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "CBytes" PrefixI False) (U1 :: Type -> Type))) :+: ((C1 (MetaCons "CMutez" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "CBool" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "CKeyHash" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "CTimestamp" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "CAddress" PrefixI False) (U1 :: Type -> Type))))) | |
| data Sing (a :: CT) Source # | |
Defined in Michelson.Typed.Sing data Sing (a :: CT) where
| |
type family ToCT a :: CT where ... Source #
Type function that converts a regular Haskell type into a comparable type
(which has kind CT)
pattern Ttimestamp :: T Source #
ttimestamp :: T Source #
isAtomicType :: Type -> Bool Source #
isSignature :: Type -> Bool Source #
isComparable :: Type -> Bool Source #
isTimestamp :: Type -> Bool Source #
data InstrAbstract op Source #
Michelson instruction with abstract parameter op. This
parameter is necessary, because at different stages of our pipeline
it will be different. Initially it can contain macros and
non-flattened instructions, but then it contains only vanilla
Michelson instructions.
Constructors
Instances
Instances
| Eq (ExtU InstrAbstract Op) => Eq Op Source # | |
| Show (ExtU InstrAbstract Op) => Show Op Source # | |
| Generic Op Source # | |
| ToJSON Instr => ToJSON Op Source # | |
Defined in Michelson.Untyped.Instr | |
| FromJSON Instr => FromJSON Op Source # | |
| Buildable Op Source # | |
Defined in Michelson.Untyped.Instr | |
| RenderDoc Op Source # | |
| type Rep Op Source # | |
Defined in Michelson.Untyped.Instr | |
type Instr = InstrAbstract Op Source #
data ExpandedOp Source #
Constructors
| PrimEx ExpandedInstr | |
| SeqEx [ExpandedOp] |
Instances
type ExpandedInstr = InstrAbstract ExpandedOp Source #
type family ExtU (instr :: Type -> Type) :: Type -> Type Source #
ExtU is extension of InstrAbstract by Morley instructions
Instances
| type ExtU InstrAbstract Source # | |
Defined in Morley.Types | |
Contract's address
data OriginationOperation Source #
Data necessary to originate a contract.
Constructors
| OriginationOperation | |
Fields
| |
Instances
mkContractAddress :: ToJSON ExpandedInstrExtU => OriginationOperation -> Address Source #
Compute address of a contract from its origination operation.
TODO [TM-62] It's certainly imprecise, real Tezos implementation doesn't use JSON, but we don't need precise format yet, so we just use some serialization format (JSON because we have necessary instances already).
Instances
| Functor Contract Source # | |
| Eq op => Eq (Contract op) Source # | |
| Data op => Data (Contract op) Source # | |
Defined in Michelson.Untyped.Contract Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Contract op -> c (Contract op) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Contract op) # toConstr :: Contract op -> Constr # dataTypeOf :: Contract op -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Contract op)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Contract op)) # gmapT :: (forall b. Data b => b -> b) -> Contract op -> Contract op # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Contract op -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Contract op -> r # gmapQ :: (forall d. Data d => d -> u) -> Contract op -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Contract op -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Contract op -> m (Contract op) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Contract op -> m (Contract op) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Contract op -> m (Contract op) # | |
| Show op => Show (Contract op) Source # | |
| Generic (Contract op) Source # | |
| ToJSON op => ToJSON (Contract op) Source # | |
Defined in Michelson.Untyped.Contract | |
| FromJSON op => FromJSON (Contract op) Source # | |
| RenderDoc op => Buildable (Contract op) Source # | |
Defined in Michelson.Untyped.Contract | |
| RenderDoc op => RenderDoc (Contract op) Source # | |
| type Rep (Contract op) Source # | |
Defined in Michelson.Untyped.Contract type Rep (Contract op) = D1 (MetaData "Contract" "Michelson.Untyped.Contract" "morley-0.2.0-DKAk4nHfsQHKu9FVdoO5vJ" False) (C1 (MetaCons "Contract" PrefixI True) (S1 (MetaSel (Just "para") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Parameter) :*: (S1 (MetaSel (Just "stor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Storage) :*: S1 (MetaSel (Just "code") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [op])))) | |
newtype Annotation tag Source #
Constructors
| Annotation Text |
Instances
pattern WithAnn :: Annotation tag -> Annotation tag Source #
type TypeAnn = Annotation TypeTag Source #
type FieldAnn = Annotation FieldTag Source #
type VarAnn = Annotation VarTag Source #
noAnn :: Annotation a Source #
ann :: Text -> Annotation a Source #
unifyAnn :: Annotation tag -> Annotation tag -> Maybe (Annotation tag) Source #
ifAnnUnified :: Annotation tag -> Annotation tag -> Bool Source #
convAnn :: Annotation tag1 -> Annotation tag2 Source #
type UntypedContract = Contract ExpandedOp Source #
type UntypedValue = Value ExpandedOp Source #