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

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) Source #

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 Michelson.Typed.Haskell.Value

Associated Types

type ToT Bool :: T Source #

IsoValue Integer Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type ToT Integer :: T Source #

IsoValue Natural Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type ToT Natural :: T Source #

IsoValue () Source # 
Instance details

Defined in 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 Michelson.Typed.Haskell.Value

Associated Types

type ToT ByteString :: T Source #

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

Defined in Michelson.Typed.Haskell.Value

Associated Types

type ToT Text :: T Source #

IsoValue MText Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type ToT MText :: T Source #

IsoValue KeyHash Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type ToT KeyHash :: T Source #

IsoValue Signature Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type ToT Signature :: T Source #

IsoValue PublicKey Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type ToT PublicKey :: T Source #

IsoValue ChainId Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type ToT ChainId :: T Source #

IsoValue Timestamp Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type ToT Timestamp :: T Source #

IsoValue Mutez Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type ToT Mutez :: T Source #

IsoValue Address Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type ToT Address :: T Source #

IsoValue EpAddress Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type ToT EpAddress :: T Source #

IsoValue Operation Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type ToT Operation :: T Source #

IsoValue MyCompoundType Source # 
Instance details

Defined in Michelson.Typed.Haskell.Instr.Sum

Associated Types

type ToT MyCompoundType :: T Source #

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

Defined in 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 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 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 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 #

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

Defined in 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 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 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 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 #

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

Defined in 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 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 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 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 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 a, IsoValue b, IsoValue c, IsoValue d, IsoValue e) => IsoValue (a, b, c, d, e) Source # 
Instance details

Defined in 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 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 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 = KnownT (ToT a) Source #

class (Typeable t, SingI t) => KnownT (t :: T) Source #

Typeable + SingI constraints.

This restricts a type to be a constructible type of T kind.

Instances

Instances details
(Typeable t, SingI t) => KnownT t Source # 
Instance details

Defined in Michelson.Typed.Sing

KnownT t => CheckScope (StorageScope t) Source # 
Instance details

Defined in Michelson.Typed.Scope

KnownT t => CheckScope (ParameterScope t) Source # 
Instance details

Defined in Michelson.Typed.Scope

KnownT t => CheckScope (ComparabilityScope t) Source # 
Instance details

Defined in Michelson.Typed.Value

class KnownT (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 Generics module.

Minimal complete definition

gToValue, gFromValue

Associated Types

type GValueType x :: T Source #

Instances

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

Defined in Michelson.Typed.Haskell.Value

Associated Types

type GValueType U1 :: T Source #

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

Defined in 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 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 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 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 

data SomeIsoValue where Source #

Hides some Haskell value put in line with Michelson Value.

Constructors

SomeIsoValue :: KnownIsoT a => a -> SomeIsoValue 

newtype AnyIsoValue Source #

Any Haskell value which can be converted to Michelson Value.

Constructors

AnyIsoValue (forall a. IsoValue a => a) 

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

Whether Michelson representation of the type is derived via Generics.

class (KnownT 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 Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TKey

WellTyped 'TUnit Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TUnit

WellTyped 'TSignature Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TSignature

WellTyped 'TChainId Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TChainId

WellTyped 'TOperation Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TOperation

WellTyped 'TInt Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TInt

WellTyped 'TNat Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TNat

WellTyped 'TString Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TString

WellTyped 'TBytes Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TBytes

WellTyped 'TMutez Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TMutez

WellTyped 'TBool Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TBool

WellTyped 'TKeyHash Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TKeyHash

WellTyped 'TTimestamp Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TTimestamp

WellTyped 'TAddress Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC 'TAddress

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

Defined in Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC ('TOption t)

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

Defined in Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC ('TList t)

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

Defined in Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC ('TSet t)

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

Defined in Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC ('TContract t)

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

Defined in Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC ('TPair t1 t2)

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

Defined in Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC ('TOr t1 t2)

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

Defined in 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 Michelson.Typed.Haskell.Value

Associated Types

type WellTypedSuperC ('TMap k v)

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

Defined in 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 Michelson.Typed.Haskell.Value

Methods

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

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

Show (ContractRef arg) Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Methods

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

show :: ContractRef arg -> String #

showList :: [ContractRef arg] -> ShowS #

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

Defined in Michelson.Typed.Haskell.Value

Methods

build :: ContractRef arg -> Builder #

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

Defined in Michelson.Typed.Haskell.Value

Associated Types

type ToT (ContractRef arg) :: T Source #

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

Defined in Michelson.Typed.Haskell.Doc

type ToT (ContractRef arg) Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

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

Defined in Michelson.Typed.Haskell.Doc

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

Replace type argument of ContractAddr with isomorphic one.

newtype BigMap k v Source #

Constructors

BigMap 

Fields

Instances

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

Defined in Michelson.Typed.Haskell.Value

Methods

(==) :: BigMap k v -> BigMap k v -> Bool #

(/=) :: BigMap k v -> BigMap k v -> Bool #

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

Defined in Michelson.Typed.Haskell.Value

Methods

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

show :: BigMap k v -> String #

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

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

Defined in 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 #

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

Defined in Michelson.Typed.Haskell.Value

Methods

mempty :: BigMap k v #

mappend :: BigMap k v -> BigMap k v -> BigMap k v #

mconcat :: [BigMap k v] -> BigMap k v #

Default (BigMap k v) Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

Methods

def :: BigMap k v #

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

Defined in 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 Michelson.Typed.Haskell.Doc

type ToT (BigMap k v) Source # 
Instance details

Defined in Michelson.Typed.Haskell.Value

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

Defined in Michelson.Typed.Haskell.Doc

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 Michelson.Typed.Haskell.Value

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

Defined in 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 #