morley-0.2.0.1: Developer tools for the Michelson Language

Safe HaskellNone
LanguageHaskell2010

Michelson.Typed.Value

Description

Module, containing data types for Michelson value.

Synopsis

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.

Constructors

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 # 
Instance details

Defined in Michelson.Typed.Value

Methods

(==) :: Val instr t -> Val instr t -> Bool #

(/=) :: Val instr t -> Val instr t -> Bool #

Show (Val instr t) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

showsPrec :: Int -> Val instr t -> ShowS #

show :: Val instr t -> String #

showList :: [Val instr t] -> ShowS #

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

Defined in Morley.Test.Gen

Methods

arbitrary :: Gen (Val instr (TPair a b)) #

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

Arbitrary (Val instr TUnit) Source # 
Instance details

Defined in Morley.Test.Gen

Methods

arbitrary :: Gen (Val instr TUnit) #

shrink :: Val instr TUnit -> [Val instr TUnit] #

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

Defined in Morley.Test.Gen

Methods

arbitrary :: Gen (Val instr (TList a)) #

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

Arbitrary (CVal a) => Arbitrary (Val instr (Tc a)) Source # 
Instance details

Defined in Morley.Test.Gen

Methods

arbitrary :: Gen (Val instr (Tc a)) #

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

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

data CreateContract instr t cp st Source #

Constructors

(Show (instr (ContractInp cp st) (ContractOut st)), Eq (instr (ContractInp cp st) (ContractOut st))) => CreateContract 

Fields

Instances
Eq (CreateContract instr t cp st) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

(==) :: 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 # 
Instance details

Defined in Michelson.Typed.Value

Methods

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 # 
Instance details

Defined in Michelson.Typed.Value

Methods

build :: CreateContract instr t cp st -> Builder #

data CVal 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 (CVal t) Source # 
Instance details

Defined in Michelson.Typed.CValue

Methods

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

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

Ord (CVal t) Source # 
Instance details

Defined in Michelson.Typed.CValue

Methods

compare :: CVal t -> CVal t -> Ordering #

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

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

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

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

max :: CVal t -> CVal t -> CVal t #

min :: CVal t -> CVal t -> CVal t #

Show (CVal t) Source # 
Instance details

Defined in Michelson.Typed.CValue

Methods

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

show :: CVal t -> String #

showList :: [CVal t] -> ShowS #

Arbitrary (CVal CInt) Source # 
Instance details

Defined in Morley.Test.Gen

Arbitrary (CVal CMutez) Source # 
Instance details

Defined in Morley.Test.Gen

Arbitrary (CVal CKeyHash) Source # 
Instance details

Defined in Morley.Test.Gen

Arbitrary (CVal CTimestamp) Source # 
Instance details

Defined in Morley.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 :: 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 
Instances
Eq (Operation instr) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

(==) :: Operation instr -> Operation instr -> Bool #

(/=) :: Operation instr -> Operation instr -> Bool #

Show (Operation instr) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

showsPrec :: Int -> Operation instr -> ShowS #

show :: Operation instr -> String #

showList :: [Operation instr] -> ShowS #

Buildable (Operation instr) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

build :: Operation instr -> Builder #

data SetDelegate Source #

Constructors

SetDelegate 

Fields

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 #

class ToVal a Source #

Converts a complex Haskell structure into Val representation.

Minimal complete definition

toVal

Instances
ToVal Bool Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

toVal :: Bool -> Val instr (ToT Bool) Source #

ToVal Int Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

toVal :: Int -> Val instr (ToT Int) Source #

ToVal Integer Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

toVal :: Integer -> Val instr (ToT Integer) Source #

ToVal Natural Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

toVal :: Natural -> Val instr (ToT Natural) Source #

ToVal Word64 Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

toVal :: Word64 -> Val instr (ToT Word64) Source #

ToVal () Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

toVal :: () -> Val instr (ToT ()) Source #

ToVal ByteString Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

toVal :: ByteString -> Val instr (ToT ByteString) Source #

ToVal Text Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

toVal :: Text -> Val instr (ToT Text) Source #

ToVal Timestamp Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

toVal :: Timestamp -> Val instr (ToT Timestamp) Source #

ToVal Mutez Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

toVal :: Mutez -> Val instr (ToT Mutez) Source #

ToVal KeyHash Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

toVal :: KeyHash -> Val instr (ToT KeyHash) Source #

ToVal Address Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

toVal :: Address -> Val instr (ToT Address) Source #

ToVal x => ToVal [x] Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

toVal :: [x] -> Val instr (ToT [x]) Source #

ToVal a => ToVal (Maybe a) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

toVal :: Maybe a -> Val instr (ToT (Maybe a)) Source #

ToCVal k => ToVal (Set k) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

toVal :: Set k -> Val instr (ToT (Set k)) Source #

(ToVal a, ToVal b) => ToVal (Either a b) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

toVal :: Either a b -> Val instr (ToT (Either a b)) Source #

(ToVal a, ToVal b) => ToVal (a, b) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

toVal :: (a, b) -> Val instr (ToT (a, b)) Source #

(ToCVal k, ToVal a) => ToVal (Map k a) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

toVal :: Map k a -> Val instr (ToT (Map k a)) Source #

class FromVal t Source #

Converts a Val value into complex Haskell type.

Minimal complete definition

fromVal

Instances
FromVal Bool Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

fromVal :: Val instr (ToT Bool) -> Bool Source #

FromVal Integer Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

fromVal :: Val instr (ToT Integer) -> Integer Source #

FromVal Natural Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

fromVal :: Val instr (ToT Natural) -> Natural Source #

FromVal () Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

fromVal :: Val instr (ToT ()) -> () Source #

FromVal ByteString Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

fromVal :: Val instr (ToT ByteString) -> ByteString Source #

FromVal Text Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

fromVal :: Val instr (ToT Text) -> Text Source #

FromVal Timestamp Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

fromVal :: Val instr (ToT Timestamp) -> Timestamp Source #

FromVal Mutez Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

fromVal :: Val instr (ToT Mutez) -> Mutez Source #

FromVal KeyHash Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

fromVal :: Val instr (ToT KeyHash) -> KeyHash Source #

FromVal Address Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

fromVal :: Val instr (ToT Address) -> Address Source #

FromVal a => FromVal [a] Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

fromVal :: Val instr (ToT [a]) -> [a] Source #

FromVal a => FromVal (Maybe a) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

fromVal :: Val instr (ToT (Maybe a)) -> Maybe a Source #

(Ord k, FromCVal k) => FromVal (Set k) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

fromVal :: Val instr (ToT (Set k)) -> Set k Source #

(FromVal a, FromVal b) => FromVal (Either a b) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

fromVal :: Val instr (ToT (Either a b)) -> Either a b Source #

(FromVal a, FromVal b) => FromVal (a, b) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

fromVal :: Val instr (ToT (a, b)) -> (a, b) Source #

(Ord k, FromCVal k, FromVal a) => FromVal (Map k a) Source # 
Instance details

Defined in Michelson.Typed.Value

Methods

fromVal :: Val instr (ToT (Map k a)) -> Map k a Source #

toVal :: ToVal a => a -> Val instr (ToT a) Source #

fromVal :: FromVal t => Val instr (ToT t) -> t Source #