morley-1.0.0: Developer tools for the Michelson Language

Safe HaskellNone
LanguageHaskell2010

Michelson.Typed.Value

Description

Module, containing data types for Michelson value.

Synopsis

Documentation

data Value' instr t where Source #

Representation of Michelson value.

Type parameter instr stands for Michelson instruction type, i.e. data type to represent an instruction of language.

Constructors

VC :: CValue t -> Value' instr (Tc t) 
VKey :: PublicKey -> Value' instr TKey 
VUnit :: Value' instr TUnit 
VSignature :: Signature -> Value' instr TSignature 
VChainId :: ChainId -> Value' instr TChainId 
VOption :: forall t instr. Maybe (Value' instr t) -> Value' instr (TOption t) 
VList :: forall t instr. [Value' instr t] -> Value' instr (TList t) 
VSet :: forall t instr. Set (CValue t) -> Value' instr (TSet t) 
VOp :: Operation' instr -> Value' instr TOperation 
VContract :: forall arg instr. Address -> SomeEntryPointCallT arg -> Value' instr (TContract arg) 
VPair :: forall l r instr. (Value' instr l, Value' instr r) -> Value' instr (TPair l r) 
VOr :: forall l r instr. Either (Value' instr l) (Value' instr r) -> Value' instr (TOr l r) 
VLam :: forall inp out instr. (forall i o. (Show (instr i o), Eq (instr i o))) => RemFail instr (inp ': '[]) (out ': '[]) -> Value' instr (TLambda inp out) 
VMap :: forall k v instr. Map (CValue k) (Value' instr v) -> Value' instr (TMap k v) 
VBigMap :: forall k v instr. Map (CValue k) (Value' instr v) -> Value' instr (TBigMap k v) 
Instances
Eq (Value' instr t) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

(==) :: Value' instr t -> Value' instr t -> Bool #

(/=) :: Value' instr t -> Value' instr t -> Bool #

Show (Value' instr t) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

showsPrec :: Int -> Value' instr t -> ShowS #

show :: Value' instr t -> String #

showList :: [Value' instr t] -> ShowS #

(Arbitrary (Value' instr a), Arbitrary (Value' instr b)) => Arbitrary (Value' instr (TPair a b)) Source # 
Instance details

Defined in Michelson.Test.Gen

Methods

arbitrary :: Gen (Value' instr (TPair a b)) #

shrink :: Value' instr (TPair a b) -> [Value' instr (TPair a b)] #

Arbitrary (Value' instr TUnit) Source # 
Instance details

Defined in Michelson.Test.Gen

Methods

arbitrary :: Gen (Value' instr TUnit) #

shrink :: Value' instr TUnit -> [Value' instr TUnit] #

Arbitrary (Value' instr a) => Arbitrary (Value' instr (TList a)) Source # 
Instance details

Defined in Michelson.Test.Gen

Methods

arbitrary :: Gen (Value' instr (TList a)) #

shrink :: Value' instr (TList a) -> [Value' instr (TList a)] #

Arbitrary (CValue a) => Arbitrary (Value' instr (Tc a)) Source # 
Instance details

Defined in Michelson.Test.Gen

Methods

arbitrary :: Gen (Value' instr (Tc a)) #

shrink :: Value' instr (Tc a) -> [Value' instr (Tc a)] #

(SingI t, HasNoOp t) => Buildable (Value' Instr t) Source # 
Instance details

Defined in Michelson.Typed.Convert

Methods

build :: Value' Instr t -> Builder #

data SomeValue' instr where Source #

Constructors

SomeValue :: (Typeable t, SingI t) => Value' instr t -> SomeValue' instr 
Instances
Eq (SomeValue' instr) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

(==) :: SomeValue' instr -> SomeValue' instr -> Bool #

(/=) :: SomeValue' instr -> SomeValue' instr -> Bool #

Show (SomeValue' instr) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

showsPrec :: Int -> SomeValue' instr -> ShowS #

show :: SomeValue' instr -> String #

showList :: [SomeValue' instr] -> ShowS #

data SomeConstrainedValue' instr (c :: T -> Constraint) where Source #

Constructors

SomeConstrainedValue :: forall (t :: T) (c :: T -> Constraint) instr. c t => Value' instr t -> SomeConstrainedValue' instr c 
Instances
Show (SomeConstrainedValue' instr c) Source # 
Instance details

Defined in Michelson.Typed.Value

type ContractInp1 param st = TPair param st Source #

type ContractInp param st = '[ContractInp1 param st] Source #

data CreateContract instr cp st Source #

Constructors

(Show (instr (ContractInp cp st) (ContractOut st)), Eq (instr (ContractInp cp st) (ContractOut st))) => CreateContract 
Instances
Eq (CreateContract instr cp st) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

(==) :: CreateContract instr cp st -> CreateContract instr cp st -> Bool #

(/=) :: CreateContract instr cp st -> CreateContract instr cp st -> Bool #

Show (CreateContract instr cp st) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

showsPrec :: Int -> CreateContract instr cp st -> ShowS #

show :: CreateContract instr cp st -> String #

showList :: [CreateContract instr cp st] -> ShowS #

Buildable (CreateContract instr cp st) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

build :: CreateContract instr cp st -> Builder #

data CValue t where Source #

Representation of comparable value in Michelson language.

By specification, we're allowed to compare only following types: int, nat, string, bytes, mutez, bool, key_hash, timestamp, address.

Only these values can be used as map keys or set elements.

Instances
Eq (CValue t) Source # 
Instance details

Defined in Michelson.Typed.CValue

Methods

(==) :: CValue t -> CValue t -> Bool #

(/=) :: CValue t -> CValue t -> Bool #

Ord (CValue t) Source # 
Instance details

Defined in Michelson.Typed.CValue

Methods

compare :: CValue t -> CValue t -> Ordering #

(<) :: CValue t -> CValue t -> Bool #

(<=) :: CValue t -> CValue t -> Bool #

(>) :: CValue t -> CValue t -> Bool #

(>=) :: CValue t -> CValue t -> Bool #

max :: CValue t -> CValue t -> CValue t #

min :: CValue t -> CValue t -> CValue t #

Show (CValue t) Source # 
Instance details

Defined in Michelson.Typed.CValue

Methods

showsPrec :: Int -> CValue t -> ShowS #

show :: CValue t -> String #

showList :: [CValue t] -> ShowS #

Arbitrary (CValue CInt) Source # 
Instance details

Defined in Michelson.Test.Gen

Arbitrary (CValue CMutez) Source # 
Instance details

Defined in Michelson.Test.Gen

Arbitrary (CValue CKeyHash) Source # 
Instance details

Defined in Michelson.Test.Gen

Arbitrary (CValue CTimestamp) Source # 
Instance details

Defined in Michelson.Test.Gen

data Operation' instr where Source #

Data type, representing operation, list of which is returned by Michelson contract (according to calling convention).

These operations are to be further executed against system state after the contract execution.

Constructors

OpTransferTokens :: ParameterScope p => TransferTokens instr p -> Operation' instr 
OpSetDelegate :: SetDelegate -> Operation' instr 
OpCreateContract :: (Show (instr (ContractInp cp st) (ContractOut st)), Typeable instr, ParameterScope cp, StorageScope st) => CreateContract instr cp st -> Operation' instr 

data SetDelegate Source #

Constructors

SetDelegate 
Instances
Eq SetDelegate Source # 
Instance details

Defined in Michelson.Typed.Value

Show SetDelegate Source # 
Instance details

Defined in Michelson.Typed.Value

Buildable SetDelegate Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

build :: SetDelegate -> Builder #

data TransferTokens instr p Source #

Constructors

TransferTokens 

Fields

Instances
Eq (TransferTokens instr p) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

(==) :: TransferTokens instr p -> TransferTokens instr p -> Bool #

(/=) :: TransferTokens instr p -> TransferTokens instr p -> Bool #

Show (TransferTokens instr p) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

showsPrec :: Int -> TransferTokens instr p -> ShowS #

show :: TransferTokens instr p -> String #

showList :: [TransferTokens instr p] -> ShowS #

Buildable (TransferTokens instr p) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

build :: TransferTokens instr p -> Builder #

data RemFail (instr :: k -> k -> Type) (i :: k) (o :: k) where Source #

Wrapper over instruction which remembers whether this instruction always fails or not.

Constructors

RfNormal :: instr i o -> RemFail instr i o 
RfAlwaysFails :: (forall o'. instr i o') -> RemFail instr i o 
Instances
Eq (instr i o) => Eq (RemFail instr i o) Source #

Ignoring distinction between constructors here, comparing only semantics.

Instance details

Defined in Michelson.Typed.Value

Methods

(==) :: RemFail instr i o -> RemFail instr i o -> Bool #

(/=) :: RemFail instr i o -> RemFail instr i o -> Bool #

(forall (o' :: k). Show (instr i o')) => Show (RemFail instr i o) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

showsPrec :: Int -> RemFail instr i o -> ShowS #

show :: RemFail instr i o -> String #

showList :: [RemFail instr i o] -> ShowS #

rfMerge :: (forall o'. instr i1 o' -> instr i2 o' -> instr i3 o') -> RemFail instr i1 o -> RemFail instr i2 o -> RemFail instr i3 o Source #

Merge two execution branches.

rfAnyInstr :: RemFail instr i o -> instr i o Source #

Get code disregard whether it always fails or not.

rfMapAnyInstr :: (forall o'. instr i1 o' -> instr i2 o') -> RemFail instr i1 o -> RemFail instr i2 o Source #

Modify inner code.

addressToVContract :: forall t instr. (ParameterScope t, ForbidOr t) => Address -> Value' instr (TContract t) Source #

Make value of contract type which refers to the given address and does not call any entrypoint.

compileEpLiftSequence :: EpLiftSequence arg param -> Value' instr arg -> Value' instr param Source #

Turn EpLiftSequence into actual function on Values.