morley-1.16.0: Developer tools for the Michelson Language
Safe HaskellNone
LanguageHaskell2010

Morley.Michelson.Typed.Haskell.Value

Description

Conversions between haskell types/values and Michelson ones.

Synopsis

Value conversions

class WellTypedToT a => IsoValue a where Source #

Isomorphism between Michelson values and plain Haskell types.

Default implementation of this typeclass converts ADTs to Michelson "pair"s and "or"s.

Minimal complete definition

Nothing

Associated Types

type ToT a :: T Source #

Type function that converts a regular Haskell type into a T type.

type ToT a = GValueType (Rep a)

Methods

toVal :: a -> Value (ToT a) Source #

Converts a Haskell structure into Value representation.

default toVal :: (Generic a, GIsoValue (Rep a), ToT a ~ GValueType (Rep a)) => a -> Value (ToT a) Source #

fromVal :: Value (ToT a) -> a Source #

Converts a Value into Haskell type.

default fromVal :: (Generic a, GIsoValue (Rep a), ToT a ~ GValueType (Rep a)) => Value (ToT a) -> a Source #

Instances

Instances details
IsoValue Bool Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT Bool :: T Source #

IsoValue Integer Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT Integer :: T Source #

IsoValue Natural Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT Natural :: T Source #

IsoValue () Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT () :: T Source #

Methods

toVal :: () -> Value (ToT ()) Source #

fromVal :: Value (ToT ()) -> () Source #

IsoValue ByteString Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT ByteString :: T Source #

(DoNotUseTextError :: Constraint) => IsoValue Text Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT Text :: T Source #

IsoValue Void Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT Void :: T Source #

IsoValue Bls12381Fr Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT Bls12381Fr :: T Source #

IsoValue Bls12381G2 Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT Bls12381G2 :: T Source #

IsoValue Bls12381G1 Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT Bls12381G1 :: T Source #

IsoValue MText Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT MText :: T Source #

IsoValue KeyHash Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT KeyHash :: T Source #

IsoValue Signature Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT Signature :: T Source #

IsoValue PublicKey Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT PublicKey :: T Source #

IsoValue ChainId Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT ChainId :: T Source #

IsoValue Timestamp Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT Timestamp :: T Source #

IsoValue Mutez Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT Mutez :: T Source #

IsoValue Address Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT Address :: T Source #

IsoValue EpAddress Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT EpAddress :: T Source #

IsoValue Operation Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT Operation :: T Source #

IsoValue MyCompoundType Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Instr.Sum

Associated Types

type ToT MyCompoundType :: T Source #

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

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT [a] :: T Source #

Methods

toVal :: [a] -> Value (ToT [a]) Source #

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

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

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (Maybe a) :: T Source #

Methods

toVal :: Maybe a -> Value (ToT (Maybe a)) Source #

fromVal :: Value (ToT (Maybe a)) -> Maybe a Source #

IsoValue a => IsoValue (Identity a) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (Identity a) :: T Source #

(Comparable (ToT c), Ord c, IsoValue c) => IsoValue (Set c) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (Set c) :: T Source #

Methods

toVal :: Set c -> Value (ToT (Set c)) Source #

fromVal :: Value (ToT (Set c)) -> Set c Source #

WellTyped t => IsoValue (Value t) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (Value t) :: T Source #

Methods

toVal :: Value t -> Value (ToT (Value t)) Source #

fromVal :: Value (ToT (Value t)) -> Value t Source #

(Comparable (ToT a), IsoValue a) => IsoValue (Ticket a) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (Ticket a) :: T Source #

Methods

toVal :: Ticket a -> Value (ToT (Ticket a)) Source #

fromVal :: Value (ToT (Ticket a)) -> Ticket a Source #

(HasNoOpToT arg, WellTypedToT arg) => IsoValue (ContractRef arg) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (ContractRef arg) :: T Source #

(IsoValue l, IsoValue r) => IsoValue (Either l r) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (Either l r) :: T Source #

Methods

toVal :: Either l r -> Value (ToT (Either l r)) Source #

fromVal :: Value (ToT (Either l r)) -> Either l r Source #

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

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (a, b) :: T Source #

Methods

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

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

(Comparable (ToT k), Ord k, IsoValue k, IsoValue v) => IsoValue (Map k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (Map k v) :: T Source #

Methods

toVal :: Map k v -> Value (ToT (Map k v)) Source #

fromVal :: Value (ToT (Map k v)) -> Map k v Source #

IsoValue (Fixed p) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (Fixed p) :: T Source #

Methods

toVal :: Fixed p -> Value (ToT (Fixed p)) Source #

fromVal :: Value (ToT (Fixed p)) -> Fixed p Source #

(Comparable (ToT k), Ord k, IsoValue k, IsoValue v, HasNoBigMapToT v, HasNoOpToT v) => IsoValue (BigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (BigMap k v) :: T Source #

Methods

toVal :: BigMap k v -> Value (ToT (BigMap k v)) Source #

fromVal :: Value (ToT (BigMap k v)) -> BigMap k v Source #

(IsoValue a, IsoValue b, IsoValue c) => IsoValue (a, b, c) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (a, b, c) :: T Source #

Methods

toVal :: (a, b, c) -> Value (ToT (a, b, c)) Source #

fromVal :: Value (ToT (a, b, c)) -> (a, b, c) Source #

IsoValue a => IsoValue (NamedF Maybe a name) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (NamedF Maybe a name) :: T Source #

Methods

toVal :: NamedF Maybe a name -> Value (ToT (NamedF Maybe a name)) Source #

fromVal :: Value (ToT (NamedF Maybe a name)) -> NamedF Maybe a name Source #

IsoValue a => IsoValue (NamedF Identity a name) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (NamedF Identity a name) :: T Source #

Methods

toVal :: NamedF Identity a name -> Value (ToT (NamedF Identity a name)) Source #

fromVal :: Value (ToT (NamedF Identity a name)) -> NamedF Identity a name Source #

(IsoValue a, IsoValue b, IsoValue c, IsoValue d) => IsoValue (a, b, c, d) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (a, b, c, d) :: T Source #

Methods

toVal :: (a, b, c, d) -> Value (ToT (a, b, c, d)) Source #

fromVal :: Value (ToT (a, b, c, d)) -> (a, b, c, d) Source #

IsoValue (BigMapId k2 v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (BigMapId k2 v) :: T Source #

Methods

toVal :: BigMapId k2 v -> Value (ToT (BigMapId k2 v)) Source #

fromVal :: Value (ToT (BigMapId k2 v)) -> BigMapId k2 v Source #

(IsoValue a, IsoValue b, IsoValue c, IsoValue d, IsoValue e) => IsoValue (a, b, c, d, e) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (a, b, c, d, e) :: T Source #

Methods

toVal :: (a, b, c, d, e) -> Value (ToT (a, b, c, d, e)) Source #

fromVal :: Value (ToT (a, b, c, d, e)) -> (a, b, c, d, e) Source #

(IsoValue a, IsoValue b, IsoValue c, IsoValue d, IsoValue e, IsoValue f) => IsoValue (a, b, c, d, e, f) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (a, b, c, d, e, f) :: T Source #

Methods

toVal :: (a, b, c, d, e, f) -> Value (ToT (a, b, c, d, e, f)) Source #

fromVal :: Value (ToT (a, b, c, d, e, f)) -> (a, b, c, d, e, f) Source #

(IsoValue a, IsoValue b, IsoValue c, IsoValue d, IsoValue e, IsoValue f, IsoValue g) => IsoValue (a, b, c, d, e, f, g) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (a, b, c, d, e, f, g) :: T Source #

Methods

toVal :: (a, b, c, d, e, f, g) -> Value (ToT (a, b, c, d, e, f, g)) Source #

fromVal :: Value (ToT (a, b, c, d, e, f, g)) -> (a, b, c, d, e, f, g) Source #

type KnownIsoT a = SingI (ToT a) Source #

class SingI (GValueType x) => GIsoValue (x :: Type -> Type) Source #

Implements ADT conversion to Michelson value.

Thanks to Generic, Michelson representation will be a balanced tree; this reduces average access time in general case.

A drawback of such approach is that, in theory, in new GHC version generified representation may change; however, chances are small and I (martoon) believe that contract versions will change much faster anyway.

In case an unbalanced tree is needed, the Generic instance can be derived by using the utilities in the Morley.Util.Generic module.

Minimal complete definition

gToValue, gFromValue

Associated Types

type GValueType x :: T Source #

Instances

Instances details
GIsoValue (V1 :: Type -> Type) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type GValueType V1 :: T Source #

GIsoValue (U1 :: Type -> Type) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type GValueType U1 :: T Source #

IsoValue a => GIsoValue (Rec0 a) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type GValueType (Rec0 a) :: T Source #

Methods

gToValue :: Rec0 a p -> Value (GValueType (Rec0 a))

gFromValue :: Value (GValueType (Rec0 a)) -> Rec0 a p

(GIsoValue x, GIsoValue y) => GIsoValue (x :+: y) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type GValueType (x :+: y) :: T Source #

Methods

gToValue :: (x :+: y) p -> Value (GValueType (x :+: y))

gFromValue :: Value (GValueType (x :+: y)) -> (x :+: y) p

(GIsoValue x, GIsoValue y) => GIsoValue (x :*: y) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type GValueType (x :*: y) :: T Source #

Methods

gToValue :: (x :*: y) p -> Value (GValueType (x :*: y))

gFromValue :: Value (GValueType (x :*: y)) -> (x :*: y) p

GIsoValue x => GIsoValue (M1 t i x) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type GValueType (M1 t i x) :: T Source #

Methods

gToValue :: M1 t i x p -> Value (GValueType (M1 t i x))

gFromValue :: Value (GValueType (M1 t i x)) -> M1 t i x p

type family ToT' (t :: k) :: T where ... Source #

Overloaded version of ToT to work on Haskell and T types.

Equations

ToT' (t :: T) = t 
ToT' (t :: Type) = ToT t 

type GenericIsoValue t = (IsoValue t, Generic t, ToT t ~ GValueType (Rep t)) Source #

Whether Michelson representation of the type is derived via Generics.

class (SingI t, WellTypedSuperC t) => WellTyped (t :: T) Source #

This class encodes Michelson rules w.r.t where it requires comparable types. Earlier we had a dedicated type for representing comparable types CT. But then we integreated those types into T. This meant that some of the types that could be formed with various combinations of T would be illegal as per Michelson typing rule. Using this class, we inductively enforce that a type and all types it contains are well typed as per Michelson's rules.

Instances

Instances details
WellTyped 'TKey Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TKey

WellTyped 'TUnit Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TUnit

WellTyped 'TSignature Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TSignature

WellTyped 'TChainId Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TChainId

WellTyped 'TOperation Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TOperation

WellTyped 'TInt Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TInt

WellTyped 'TNat Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TNat

WellTyped 'TString Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TString

WellTyped 'TBytes Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TBytes

WellTyped 'TMutez Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TMutez

WellTyped 'TBool Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TBool

WellTyped 'TKeyHash Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TKeyHash

WellTyped 'TBls12381Fr Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TBls12381Fr

WellTyped 'TBls12381G1 Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TBls12381G1

WellTyped 'TBls12381G2 Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TBls12381G2

WellTyped 'TTimestamp Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TTimestamp

WellTyped 'TAddress Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TAddress

WellTyped 'TNever Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TNever

WellTyped t => WellTyped ('TOption t) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC ('TOption t)

WellTyped t => WellTyped ('TList t) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC ('TList t)

(Comparable t, WellTyped t) => WellTyped ('TSet t) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC ('TSet t)

(WellTyped t, HasNoOp t) => WellTyped ('TContract t) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC ('TContract t)

(WellTyped t, Comparable t) => WellTyped ('TTicket t) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC ('TTicket t)

(WellTyped t1, WellTyped t2) => WellTyped ('TPair t1 t2) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC ('TPair t1 t2)

(WellTyped t1, WellTyped t2) => WellTyped ('TOr t1 t2) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC ('TOr t1 t2)

(WellTyped t1, WellTyped t2) => WellTyped ('TLambda t1 t2) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC ('TLambda t1 t2)

(Comparable k, WellTyped k, WellTyped v) => WellTyped ('TMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC ('TMap k v)

(Comparable k, WellTyped k, WellTyped v, HasNoBigMap v, HasNoOp v) => WellTyped ('TBigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC ('TBigMap k v)

data Dict a where #

Values of type Dict p capture a dictionary for a constraint of type p.

e.g.

Dict :: Dict (Eq Int)

captures a dictionary that proves we have an:

instance Eq Int

Pattern matching on the Dict constructor will bring this instance into scope.

Constructors

Dict :: forall a. a => Dict a 

Instances

Instances details
HasDict a (Dict a) 
Instance details

Defined in Data.Constraint

Methods

evidence :: Dict a -> Dict a #

a :=> (Read (Dict a)) 
Instance details

Defined in Data.Constraint

Methods

ins :: a :- Read (Dict a) #

a :=> (Monoid (Dict a)) 
Instance details

Defined in Data.Constraint

Methods

ins :: a :- Monoid (Dict a) #

a :=> (Enum (Dict a)) 
Instance details

Defined in Data.Constraint

Methods

ins :: a :- Enum (Dict a) #

a :=> (Bounded (Dict a)) 
Instance details

Defined in Data.Constraint

Methods

ins :: a :- Bounded (Dict a) #

() :=> (Eq (Dict a)) 
Instance details

Defined in Data.Constraint

Methods

ins :: () :- Eq (Dict a) #

() :=> (Ord (Dict a)) 
Instance details

Defined in Data.Constraint

Methods

ins :: () :- Ord (Dict a) #

() :=> (Show (Dict a)) 
Instance details

Defined in Data.Constraint

Methods

ins :: () :- Show (Dict a) #

() :=> (Semigroup (Dict a)) 
Instance details

Defined in Data.Constraint

Methods

ins :: () :- Semigroup (Dict a) #

a => Bounded (Dict a) 
Instance details

Defined in Data.Constraint

Methods

minBound :: Dict a #

maxBound :: Dict a #

a => Enum (Dict a) 
Instance details

Defined in Data.Constraint

Methods

succ :: Dict a -> Dict a #

pred :: Dict a -> Dict a #

toEnum :: Int -> Dict a #

fromEnum :: Dict a -> Int #

enumFrom :: Dict a -> [Dict a] #

enumFromThen :: Dict a -> Dict a -> [Dict a] #

enumFromTo :: Dict a -> Dict a -> [Dict a] #

enumFromThenTo :: Dict a -> Dict a -> Dict a -> [Dict a] #

Eq (Dict a) 
Instance details

Defined in Data.Constraint

Methods

(==) :: Dict a -> Dict a -> Bool #

(/=) :: Dict a -> Dict a -> Bool #

(Typeable p, p) => Data (Dict p) 
Instance details

Defined in Data.Constraint

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Dict p -> c (Dict p) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Dict p) #

toConstr :: Dict p -> Constr #

dataTypeOf :: Dict p -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Dict p)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Dict p)) #

gmapT :: (forall b. Data b => b -> b) -> Dict p -> Dict p #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Dict p -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Dict p -> r #

gmapQ :: (forall d. Data d => d -> u) -> Dict p -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Dict p -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Dict p -> m (Dict p) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Dict p -> m (Dict p) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Dict p -> m (Dict p) #

Ord (Dict a) 
Instance details

Defined in Data.Constraint

Methods

compare :: Dict a -> Dict a -> Ordering #

(<) :: Dict a -> Dict a -> Bool #

(<=) :: Dict a -> Dict a -> Bool #

(>) :: Dict a -> Dict a -> Bool #

(>=) :: Dict a -> Dict a -> Bool #

max :: Dict a -> Dict a -> Dict a #

min :: Dict a -> Dict a -> Dict a #

a => Read (Dict a) 
Instance details

Defined in Data.Constraint

Show (Dict a) 
Instance details

Defined in Data.Constraint

Methods

showsPrec :: Int -> Dict a -> ShowS #

show :: Dict a -> String #

showList :: [Dict a] -> ShowS #

Semigroup (Dict a) 
Instance details

Defined in Data.Constraint

Methods

(<>) :: Dict a -> Dict a -> Dict a #

sconcat :: NonEmpty (Dict a) -> Dict a #

stimes :: Integral b => b -> Dict a -> Dict a #

a => Monoid (Dict a) 
Instance details

Defined in Data.Constraint

Methods

mempty :: Dict a #

mappend :: Dict a -> Dict a -> Dict a #

mconcat :: [Dict a] -> Dict a #

NFData (Dict c) 
Instance details

Defined in Data.Constraint

Methods

rnf :: Dict c -> () #

Re-exporting to use in tests.

Missing Haskell analogies to Michelson values

type EntrypointCall param arg = EntrypointCallT (ToT param) (ToT arg) Source #

data ContractRef (arg :: Type) Source #

Since Contract name is used to designate contract code, lets call analogy of TContract type as follows.

Note that type argument always designates an argument of entrypoint. If a contract has explicit default entrypoint (and no root entrypoint), ContractRef referring to it can never have the entire parameter as its type argument.

Instances

Instances details
Eq (ContractRef arg) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Methods

(==) :: ContractRef arg -> ContractRef arg -> Bool #

(/=) :: ContractRef arg -> ContractRef arg -> Bool #

Show (ContractRef arg) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Methods

showsPrec :: Int -> ContractRef arg -> ShowS #

show :: ContractRef arg -> String #

showList :: [ContractRef arg] -> ShowS #

IsoValue (ContractRef arg) => Buildable (ContractRef arg) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Methods

build :: ContractRef arg -> Builder #

(HasNoOpToT arg, WellTypedToT arg) => IsoValue (ContractRef arg) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (ContractRef arg) :: T Source #

PolyTypeHasDocC '[cp] => TypeHasDoc (ContractRef cp) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

type ToT (ContractRef arg) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

type ToT (ContractRef arg) = 'TContract (ToT arg)
type TypeDocFieldDescriptions (ContractRef cp) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

coerceContractRef :: ToT a ~ ToT b => ContractRef a -> ContractRef b Source #

Replace type argument of ContractRef with isomorphic one.

data Ticket (arg :: Type) Source #

Ticket type.

Constructors

Ticket 

Fields

Instances

Instances details
Eq arg => Eq (Ticket arg) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Methods

(==) :: Ticket arg -> Ticket arg -> Bool #

(/=) :: Ticket arg -> Ticket arg -> Bool #

Show arg => Show (Ticket arg) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Methods

showsPrec :: Int -> Ticket arg -> ShowS #

show :: Ticket arg -> String #

showList :: [Ticket arg] -> ShowS #

(Comparable (ToT a), IsoValue a) => IsoValue (Ticket a) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (Ticket a) :: T Source #

Methods

toVal :: Ticket a -> Value (ToT (Ticket a)) Source #

fromVal :: Value (ToT (Ticket a)) -> Ticket a Source #

PolyTypeHasDocC '[a] => TypeHasDoc (Ticket a) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

type ToT (Ticket a) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

type ToT (Ticket a) = 'TTicket (ToT a)
type TypeDocFieldDescriptions (Ticket a) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

newtype BigMapId k v Source #

Phantom type that represents the ID of a big_map with keys of type k and values of type v.

Constructors

BigMapId 

Fields

Instances

Instances details
(Typeable k2, Typeable v, Typeable k1, Typeable k3) => Data (BigMapId k2 v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BigMapId k2 v -> c (BigMapId k2 v) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (BigMapId k2 v) #

toConstr :: BigMapId k2 v -> Constr #

dataTypeOf :: BigMapId k2 v -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (BigMapId k2 v)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (BigMapId k2 v)) #

gmapT :: (forall b. Data b => b -> b) -> BigMapId k2 v -> BigMapId k2 v #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BigMapId k2 v -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BigMapId k2 v -> r #

gmapQ :: (forall d. Data d => d -> u) -> BigMapId k2 v -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BigMapId k2 v -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BigMapId k2 v -> m (BigMapId k2 v) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BigMapId k2 v -> m (BigMapId k2 v) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BigMapId k2 v -> m (BigMapId k2 v) #

Num (BigMapId k2 v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Methods

(+) :: BigMapId k2 v -> BigMapId k2 v -> BigMapId k2 v #

(-) :: BigMapId k2 v -> BigMapId k2 v -> BigMapId k2 v #

(*) :: BigMapId k2 v -> BigMapId k2 v -> BigMapId k2 v #

negate :: BigMapId k2 v -> BigMapId k2 v #

abs :: BigMapId k2 v -> BigMapId k2 v #

signum :: BigMapId k2 v -> BigMapId k2 v #

fromInteger :: Integer -> BigMapId k2 v #

Show (BigMapId k2 v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Methods

showsPrec :: Int -> BigMapId k2 v -> ShowS #

show :: BigMapId k2 v -> String #

showList :: [BigMapId k2 v] -> ShowS #

Buildable (BigMapId k2 v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Methods

build :: BigMapId k2 v -> Builder #

IsoValue (BigMapId k2 v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (BigMapId k2 v) :: T Source #

Methods

toVal :: BigMapId k2 v -> Value (ToT (BigMapId k2 v)) Source #

fromVal :: Value (ToT (BigMapId k2 v)) -> BigMapId k2 v Source #

type ToT (BigMapId k2 v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

type ToT (BigMapId k2 v) = ToT Natural

data BigMap k v Source #

Constructors

BigMap 

Fields

Instances

Instances details
Foldable (BigMap k) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Methods

fold :: Monoid m => BigMap k m -> m #

foldMap :: Monoid m => (a -> m) -> BigMap k a -> m #

foldMap' :: Monoid m => (a -> m) -> BigMap k a -> m #

foldr :: (a -> b -> b) -> b -> BigMap k a -> b #

foldr' :: (a -> b -> b) -> b -> BigMap k a -> b #

foldl :: (b -> a -> b) -> b -> BigMap k a -> b #

foldl' :: (b -> a -> b) -> b -> BigMap k a -> b #

foldr1 :: (a -> a -> a) -> BigMap k a -> a #

foldl1 :: (a -> a -> a) -> BigMap k a -> a #

toList :: BigMap k a -> [a] #

null :: BigMap k a -> Bool #

length :: BigMap k a -> Int #

elem :: Eq a => a -> BigMap k a -> Bool #

maximum :: Ord a => BigMap k a -> a #

minimum :: Ord a => BigMap k a -> a #

sum :: Num a => BigMap k a -> a #

product :: Num a => BigMap k a -> a #

Ord k => IsList (BigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type Item (BigMap k v) #

Methods

fromList :: [Item (BigMap k v)] -> BigMap k v #

fromListN :: Int -> [Item (BigMap k v)] -> BigMap k v #

toList :: BigMap k v -> [Item (BigMap k v)] #

(Data k, Data v, Ord k) => Data (BigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BigMap k v -> c (BigMap k v) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (BigMap k v) #

toConstr :: BigMap k v -> Constr #

dataTypeOf :: BigMap k v -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (BigMap k v)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (BigMap k v)) #

gmapT :: (forall b. Data b => b -> b) -> BigMap k v -> BigMap k v #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BigMap k v -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BigMap k v -> r #

gmapQ :: (forall d. Data d => d -> u) -> BigMap k v -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BigMap k v -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BigMap k v -> m (BigMap k v) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BigMap k v -> m (BigMap k v) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BigMap k v -> m (BigMap k v) #

(Show k, Show v) => Show (BigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Methods

showsPrec :: Int -> BigMap k v -> ShowS #

show :: BigMap k v -> String #

showList :: [BigMap k v] -> ShowS #

Generic (BigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type Rep (BigMap k v) :: Type -> Type #

Methods

from :: BigMap k v -> Rep (BigMap k v) x #

to :: Rep (BigMap k v) x -> BigMap k v #

Ord k => Semigroup (BigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Methods

(<>) :: BigMap k v -> BigMap k v -> BigMap k v #

sconcat :: NonEmpty (BigMap k v) -> BigMap k v #

stimes :: Integral b => b -> BigMap k v -> BigMap k v #

Default (BigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Methods

def :: BigMap k v #

(Ord k, Buildable k, Buildable v) => Buildable (BigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Methods

build :: BigMap k v -> Builder #

Container (BigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type Element (BigMap k v) #

Methods

toList :: BigMap k v -> [Element (BigMap k v)] #

null :: BigMap k v -> Bool #

foldr :: (Element (BigMap k v) -> b -> b) -> b -> BigMap k v -> b #

foldl :: (b -> Element (BigMap k v) -> b) -> b -> BigMap k v -> b #

foldl' :: (b -> Element (BigMap k v) -> b) -> b -> BigMap k v -> b #

length :: BigMap k v -> Int #

elem :: Element (BigMap k v) -> BigMap k v -> Bool #

foldMap :: Monoid m => (Element (BigMap k v) -> m) -> BigMap k v -> m #

fold :: BigMap k v -> Element (BigMap k v) #

foldr' :: (Element (BigMap k v) -> b -> b) -> b -> BigMap k v -> b #

notElem :: Element (BigMap k v) -> BigMap k v -> Bool #

all :: (Element (BigMap k v) -> Bool) -> BigMap k v -> Bool #

any :: (Element (BigMap k v) -> Bool) -> BigMap k v -> Bool #

and :: BigMap k v -> Bool #

or :: BigMap k v -> Bool #

find :: (Element (BigMap k v) -> Bool) -> BigMap k v -> Maybe (Element (BigMap k v)) #

safeHead :: BigMap k v -> Maybe (Element (BigMap k v)) #

safeMaximum :: BigMap k v -> Maybe (Element (BigMap k v)) #

safeMinimum :: BigMap k v -> Maybe (Element (BigMap k v)) #

safeFoldr1 :: (Element (BigMap k v) -> Element (BigMap k v) -> Element (BigMap k v)) -> BigMap k v -> Maybe (Element (BigMap k v)) #

safeFoldl1 :: (Element (BigMap k v) -> Element (BigMap k v) -> Element (BigMap k v)) -> BigMap k v -> Maybe (Element (BigMap k v)) #

One (BigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type OneItem (BigMap k v) #

Methods

one :: OneItem (BigMap k v) -> BigMap k v #

(Comparable (ToT k), Ord k, IsoValue k, IsoValue v, HasNoBigMapToT v, HasNoOpToT v) => IsoValue (BigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToT (BigMap k v) :: T Source #

Methods

toVal :: BigMap k v -> Value (ToT (BigMap k v)) Source #

fromVal :: Value (ToT (BigMap k v)) -> BigMap k v Source #

(PolyCTypeHasDocC '[k], PolyTypeHasDocC '[v], Ord k) => TypeHasDoc (BigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

type Rep (BigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

type Rep (BigMap k v) = D1 ('MetaData "BigMap" "Morley.Michelson.Typed.Haskell.Value" "morley-1.16.0-inplace" 'False) (C1 ('MetaCons "BigMap" 'PrefixI 'True) (S1 ('MetaSel ('Just "bmId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (BigMapId k v))) :*: S1 ('MetaSel ('Just "bmMap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map k v))))
type Item (BigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

type Item (BigMap k v) = Item (Map k v)
type Element (BigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

type Element (BigMap k v) = ElementDefault (BigMap k v)
type OneItem (BigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

type OneItem (BigMap k v) = OneItem (Map k v)
type ToT (BigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

type ToT (BigMap k v) = 'TBigMap (ToT k) (ToT v)
type TypeDocFieldDescriptions (BigMap k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Doc

class ToBigMap m where Source #

Associated Types

type ToBigMapKey m Source #

type ToBigMapValue m Source #

Instances

Instances details
Ord k => ToBigMap [(k, v)] Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToBigMapKey [(k, v)] Source #

type ToBigMapValue [(k, v)] Source #

Methods

mkBigMap :: [(k, v)] -> BigMap (ToBigMapKey [(k, v)]) (ToBigMapValue [(k, v)]) Source #

Ord k => ToBigMap (NonEmpty (k, v)) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToBigMapKey (NonEmpty (k, v)) Source #

type ToBigMapValue (NonEmpty (k, v)) Source #

Methods

mkBigMap :: NonEmpty (k, v) -> BigMap (ToBigMapKey (NonEmpty (k, v))) (ToBigMapValue (NonEmpty (k, v))) Source #

ToBigMap (Map k v) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Associated Types

type ToBigMapKey (Map k v) Source #

type ToBigMapValue (Map k v) Source #

Methods

mkBigMap :: Map k v -> BigMap (ToBigMapKey (Map k v)) (ToBigMapValue (Map k v)) Source #

Stack conversion

type family ToTs (ts :: [Type]) :: [T] where ... Source #

Type function to convert a Haskell stack type to T-based one.

Equations

ToTs '[] = '[] 
ToTs (x ': xs) = ToT x ': ToTs xs 

type family ToTs' (t :: [k]) :: [T] where ... Source #

Overloaded version of ToTs to work on Haskell and T stacks.

Equations

ToTs' (t :: [T]) = t 
ToTs' (a :: [Type]) = ToTs a 

class IsoValuesStack (ts :: [Type]) where Source #

Isomorphism between Michelson stack and its Haskell reflection.

Instances

Instances details
IsoValuesStack ('[] :: [Type]) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

(IsoValue t, IsoValuesStack st) => IsoValuesStack (t ': st) Source # 
Instance details

Defined in Morley.Michelson.Typed.Haskell.Value

Methods

toValStack :: Rec Identity (t ': st) -> Rec Value (ToTs (t ': st)) Source #

fromValStack :: Rec Value (ToTs (t ': st)) -> Rec Identity (t ': st) Source #

totsAppendLemma :: forall a b. KnownList a => Dict (ToTs (a ++ b) ~ (ToTs a ++ ToTs b)) Source #