Safe Haskell | None |
---|---|
Language | Haskell2010 |
Module, containing data types for Michelson value.
Synopsis
- data Val instr t where
- VC :: CVal t -> Val instr (Tc t)
- VKey :: PublicKey -> Val instr TKey
- VUnit :: Val instr TUnit
- VSignature :: Signature -> Val instr TSignature
- VOption :: Maybe (Val instr t) -> Val instr (TOption t)
- VList :: [Val instr t] -> Val instr (TList t)
- VSet :: Set (CVal t) -> Val instr (TSet t)
- VOp :: Operation instr -> Val instr TOperation
- VContract :: Address -> Val instr (TContract p)
- VPair :: (Val instr l, Val instr r) -> Val instr (TPair l r)
- VOr :: Either (Val instr l) (Val instr r) -> Val instr (TOr l r)
- VLam :: (Show (instr '[inp] '[out]), Eq (instr '[inp] '[out])) => instr (inp ': '[]) (out ': '[]) -> Val instr (TLambda inp out)
- VMap :: Map (CVal k) (Val instr v) -> Val instr (TMap k v)
- VBigMap :: Map (CVal k) (Val instr v) -> Val instr (TBigMap k v)
- type ContractInp param st = '[TPair param st]
- type ContractOut st = '[TPair (TList TOperation) st]
- data CreateAccount = CreateAccount {
- caManager :: !KeyHash
- caDelegate :: !(Maybe KeyHash)
- caSpendable :: !Bool
- caBalance :: !Mutez
- data CreateContract instr t cp st = (Show (instr (ContractInp cp st) (ContractOut st)), Eq (instr (ContractInp cp st) (ContractOut st))) => CreateContract {
- ccManager :: !KeyHash
- ccDelegate :: !(Maybe KeyHash)
- ccSpendable :: !Bool
- ccDelegatable :: !Bool
- ccBalance :: !Mutez
- ccStorageVal :: !(Val instr t)
- ccContractCode :: !(instr (ContractInp cp st) (ContractOut st))
- data CVal t where
- CvInt :: Integer -> CVal CInt
- CvNat :: Natural -> CVal CNat
- CvString :: Text -> CVal CString
- CvBytes :: ByteString -> CVal CBytes
- CvMutez :: Mutez -> CVal CMutez
- CvBool :: Bool -> CVal CBool
- CvKeyHash :: KeyHash -> CVal CKeyHash
- CvTimestamp :: Timestamp -> CVal CTimestamp
- CvAddress :: Address -> CVal CAddress
- data Operation instr where
- OpTransferTokens :: Typeable p => TransferTokens instr p -> Operation instr
- OpSetDelegate :: SetDelegate -> Operation instr
- OpCreateAccount :: CreateAccount -> Operation instr
- OpCreateContract :: (Show (instr (ContractInp cp st) (ContractOut st)), SingI cp, SingI st, Typeable t, Typeable cp, Typeable st) => CreateContract instr t cp st -> Operation instr
- data SetDelegate = SetDelegate {
- sdMbKeyHash :: !(Maybe KeyHash)
- data TransferTokens instr p = TransferTokens {
- ttContractParameter :: !(Val instr p)
- ttAmount :: !Mutez
- ttContract :: !(Val instr (TContract p))
- class ToVal a
- class FromVal t
- toVal :: ToVal a => a -> Val instr (ToT a)
- fromVal :: FromVal t => Val instr (ToT t) -> t
Documentation
data Val 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.
VC :: CVal t -> Val instr (Tc t) | |
VKey :: PublicKey -> Val instr TKey | |
VUnit :: Val instr TUnit | |
VSignature :: Signature -> Val instr TSignature | |
VOption :: Maybe (Val instr t) -> Val instr (TOption t) | |
VList :: [Val instr t] -> Val instr (TList t) | |
VSet :: Set (CVal t) -> Val instr (TSet t) | |
VOp :: Operation instr -> Val instr TOperation | |
VContract :: Address -> Val instr (TContract p) | |
VPair :: (Val instr l, Val instr r) -> Val instr (TPair l r) | |
VOr :: Either (Val instr l) (Val instr r) -> Val instr (TOr l r) | |
VLam :: (Show (instr '[inp] '[out]), Eq (instr '[inp] '[out])) => instr (inp ': '[]) (out ': '[]) -> Val instr (TLambda inp out) | |
VMap :: Map (CVal k) (Val instr v) -> Val instr (TMap k v) | |
VBigMap :: Map (CVal k) (Val instr v) -> Val instr (TBigMap k v) |
Instances
Eq (Val instr t) Source # | |
Show (Val instr t) Source # | |
(Arbitrary (Val instr a), Arbitrary (Val instr b)) => Arbitrary (Val instr (TPair a b)) Source # | |
Arbitrary (Val instr TUnit) Source # | |
Arbitrary (Val instr a) => Arbitrary (Val instr (TList a)) Source # | |
Arbitrary (CVal a) => Arbitrary (Val instr (Tc a)) Source # | |
type ContractInp param st = '[TPair param st] Source #
type ContractOut st = '[TPair (TList TOperation) st] Source #
data CreateAccount Source #
CreateAccount | |
|
Instances
Eq CreateAccount Source # | |
Defined in Michelson.Typed.Value (==) :: CreateAccount -> CreateAccount -> Bool # (/=) :: CreateAccount -> CreateAccount -> Bool # | |
Show CreateAccount Source # | |
Defined in Michelson.Typed.Value showsPrec :: Int -> CreateAccount -> ShowS # show :: CreateAccount -> String # showList :: [CreateAccount] -> ShowS # | |
Buildable CreateAccount Source # | |
Defined in Michelson.Typed.Value build :: CreateAccount -> Builder # |
data CreateContract instr t cp st Source #
(Show (instr (ContractInp cp st) (ContractOut st)), Eq (instr (ContractInp cp st) (ContractOut st))) => CreateContract | |
|
Instances
Eq (CreateContract instr t cp st) Source # | |
Defined in Michelson.Typed.Value (==) :: CreateContract instr t cp st -> CreateContract instr t cp st -> Bool # (/=) :: CreateContract instr t cp st -> CreateContract instr t cp st -> Bool # | |
Show (CreateContract instr t cp st) Source # | |
Defined in Michelson.Typed.Value showsPrec :: Int -> CreateContract instr t cp st -> ShowS # show :: CreateContract instr t cp st -> String # showList :: [CreateContract instr t cp st] -> ShowS # | |
Buildable (CreateContract instr t cp st) Source # | |
Defined in Michelson.Typed.Value build :: CreateContract instr t cp st -> Builder # |
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.
CvInt :: Integer -> CVal CInt | |
CvNat :: Natural -> CVal CNat | |
CvString :: Text -> CVal CString | |
CvBytes :: ByteString -> CVal CBytes | |
CvMutez :: Mutez -> CVal CMutez | |
CvBool :: Bool -> CVal CBool | |
CvKeyHash :: KeyHash -> CVal CKeyHash | |
CvTimestamp :: Timestamp -> CVal CTimestamp | |
CvAddress :: Address -> CVal CAddress |
Instances
Eq (CVal t) Source # | |
Ord (CVal t) Source # | |
Show (CVal t) Source # | |
Arbitrary (CVal CInt) Source # | |
Arbitrary (CVal CMutez) Source # | |
Arbitrary (CVal CKeyHash) Source # | |
Arbitrary (CVal CTimestamp) Source # | |
Defined in Morley.Test.Gen arbitrary :: Gen (CVal CTimestamp) # shrink :: CVal CTimestamp -> [CVal CTimestamp] # |
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.
OpTransferTokens :: Typeable p => TransferTokens instr p -> Operation instr | |
OpSetDelegate :: SetDelegate -> Operation instr | |
OpCreateAccount :: CreateAccount -> Operation instr | |
OpCreateContract :: (Show (instr (ContractInp cp st) (ContractOut st)), SingI cp, SingI st, Typeable t, Typeable cp, Typeable st) => CreateContract instr t cp st -> Operation instr |
data SetDelegate Source #
SetDelegate | |
|
Instances
Eq SetDelegate Source # | |
Defined in Michelson.Typed.Value (==) :: SetDelegate -> SetDelegate -> Bool # (/=) :: SetDelegate -> SetDelegate -> Bool # | |
Show SetDelegate Source # | |
Defined in Michelson.Typed.Value showsPrec :: Int -> SetDelegate -> ShowS # show :: SetDelegate -> String # showList :: [SetDelegate] -> ShowS # | |
Buildable SetDelegate Source # | |
Defined in Michelson.Typed.Value build :: SetDelegate -> Builder # |
data TransferTokens instr p Source #
TransferTokens | |
|
Instances
Eq (TransferTokens instr p) Source # | |
Defined in Michelson.Typed.Value (==) :: TransferTokens instr p -> TransferTokens instr p -> Bool # (/=) :: TransferTokens instr p -> TransferTokens instr p -> Bool # | |
Show (TransferTokens instr p) Source # | |
Defined in Michelson.Typed.Value showsPrec :: Int -> TransferTokens instr p -> ShowS # show :: TransferTokens instr p -> String # showList :: [TransferTokens instr p] -> ShowS # | |
Buildable (TransferTokens instr p) Source # | |
Defined in Michelson.Typed.Value build :: TransferTokens instr p -> Builder # |
Converts a complex Haskell structure into Val
representation.
Instances
ToVal Bool Source # | |
ToVal Int Source # | |
ToVal Integer Source # | |
ToVal Natural Source # | |
ToVal Word64 Source # | |
ToVal () Source # | |
ToVal ByteString Source # | |
Defined in Michelson.Typed.Value toVal :: ByteString -> Val instr (ToT ByteString) Source # | |
ToVal Text Source # | |
ToVal Timestamp Source # | |
ToVal Mutez Source # | |
ToVal KeyHash Source # | |
ToVal Address Source # | |
ToVal x => ToVal [x] Source # | |
ToVal a => ToVal (Maybe a) Source # | |
ToCVal k => ToVal (Set k) Source # | |
(ToVal a, ToVal b) => ToVal (Either a b) Source # | |
(ToVal a, ToVal b) => ToVal (a, b) Source # | |
(ToCVal k, ToVal a) => ToVal (Map k a) Source # | |
Converts a Val
value into complex Haskell type.
Instances
FromVal Bool Source # | |
FromVal Integer Source # | |
FromVal Natural Source # | |
FromVal () Source # | |
FromVal ByteString Source # | |
Defined in Michelson.Typed.Value fromVal :: Val instr (ToT ByteString) -> ByteString Source # | |
FromVal Text Source # | |
FromVal Timestamp Source # | |
FromVal Mutez Source # | |
FromVal KeyHash Source # | |
FromVal Address Source # | |
FromVal a => FromVal [a] Source # | |
FromVal a => FromVal (Maybe a) Source # | |
(Ord k, FromCVal k) => FromVal (Set k) Source # | |
(FromVal a, FromVal b) => FromVal (Either a b) Source # | |
(FromVal a, FromVal b) => FromVal (a, b) Source # | |
(Ord k, FromCVal k, FromVal a) => FromVal (Map k a) Source # | |