Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- nop :: s :-> s
- drop :: (a ': s) :-> s
- dropN :: forall (n :: Nat) (s :: [Type]). (SingIPeano n, RequireLongerOrSameLength (ToTs s) (ToPeano n), Drop (ToPeano n) (ToTs s) ~ ToTs (Drop (ToPeano n) s)) => s :-> Drop (ToPeano n) s
- type ConstraintDUPNLorentz (n :: Peano) (inp :: [Type]) (out :: [Type]) (a :: Type) = (ConstraintDUPN n (ToTs inp) (ToTs out) (ToT a), ConstraintDUPN' Type n inp out a, SingI n)
- dup :: forall a s. Dupable a => (a ': s) :-> (a ': (a ': s))
- dupNPeano :: forall (n :: Peano) a inp out. (ConstraintDUPNLorentz n inp out a, Dupable a) => inp :-> out
- dupN :: forall (n :: Nat) a inp out. (ConstraintDUPNLorentz (ToPeano n) inp out a, Dupable a) => inp :-> out
- swap :: (a ': (b ': s)) :-> (b ': (a ': s))
- type ConstraintDIGLorentz (n :: Peano) (inp :: [Type]) (out :: [Type]) (a :: Type) = (ConstraintDIG n (ToTs inp) (ToTs out) (ToT a), ConstraintDIG' Type n inp out a, SingI n)
- digPeano :: forall (n :: Peano) inp out a. ConstraintDIGLorentz n inp out a => inp :-> out
- dig :: forall (n :: Nat) inp out a. ConstraintDIGLorentz (ToPeano n) inp out a => inp :-> out
- type ConstraintDUGLorentz (n :: Peano) (inp :: [Type]) (out :: [Type]) (a :: Type) = (ConstraintDUG n (ToTs inp) (ToTs out) (ToT a), ConstraintDUG' Type n inp out a, SingI n)
- dugPeano :: forall (n :: Peano) inp out a. ConstraintDUGLorentz n inp out a => inp :-> out
- dug :: forall (n :: Nat) inp out a. ConstraintDUGLorentz (ToPeano n) inp out a => inp :-> out
- push :: forall t s. NiceConstant t => t -> s :-> (t ': s)
- some :: (a ': s) :-> (Maybe a ': s)
- none :: forall a s. KnownValue a => s :-> (Maybe a ': s)
- unit :: s :-> (() ': s)
- ifNone :: (s :-> s') -> ((a ': s) :-> s') -> (Maybe a ': s) :-> s'
- pair :: (a ': (b ': s)) :-> ((a, b) ': s)
- car :: ((a, b) ': s) :-> (a ': s)
- cdr :: ((a, b) ': s) :-> (b ': s)
- unpair :: ((a, b) ': s) :-> (a ': (b ': s))
- left :: forall a b s. KnownValue b => (a ': s) :-> (Either a b ': s)
- right :: forall a b s. KnownValue a => (b ': s) :-> (Either a b ': s)
- ifLeft :: ((a ': s) :-> s') -> ((b ': s) :-> s') -> (Either a b ': s) :-> s'
- nil :: KnownValue p => s :-> (List p ': s)
- cons :: (a ': (List a ': s)) :-> (List a ': s)
- size :: SizeOpHs c => (c ': s) :-> (Natural ': s)
- emptySet :: NiceComparable e => s :-> (Set e ': s)
- emptyMap :: (NiceComparable k, KnownValue v) => s :-> (Map k v ': s)
- emptyBigMap :: (NiceComparable k, KnownValue v, NiceNoBigMap v) => s :-> (BigMap k v ': s)
- map :: (MapOpHs c, IsoMapOpRes c b, KnownValue b, HasCallStack) => ((MapOpInpHs c ': s) :-> (b ': s)) -> (c ': s) :-> (MapOpResHs c b ': s)
- iter :: (IterOpHs c, HasCallStack) => ((IterOpElHs c ': s) :-> s) -> (c ': s) :-> s
- mem :: MemOpHs c => (MemOpKeyHs c ': (c ': s)) :-> (Bool ': s)
- get :: (GetOpHs c, KnownValue (GetOpValHs c)) => (GetOpKeyHs c ': (c ': s)) :-> (Maybe (GetOpValHs c) ': s)
- type ConstraintPairGetLorentz (n :: Nat) (pair :: Type) = (ConstraintGetN (ToPeano n) (ToT pair), ToT (PairGetHs (ToPeano n) pair) ~ GetN (ToPeano n) (ToT pair), SingIPeano n)
- type family PairGetHs (ix :: Peano) (pair :: Type) :: Type where ...
- pairGet :: forall (n :: Nat) (pair :: Type) (s :: [Type]). ConstraintPairGetLorentz n pair => (pair ': s) :-> (PairGetHs (ToPeano n) pair ': s)
- update :: UpdOpHs c => (UpdOpKeyHs c ': (UpdOpParamsHs c ': (c ': s))) :-> (c ': s)
- getAndUpdate :: (GetOpHs c, UpdOpHs c, KnownValue (GetOpValHs c), UpdOpKeyHs c ~ GetOpKeyHs c) => (UpdOpKeyHs c ': (UpdOpParamsHs c ': (c ': s))) :-> (Maybe (GetOpValHs c) ': (c ': s))
- type ConstraintPairUpdateLorentz (n :: Nat) (val :: Type) (pair :: Type) = (ConstraintUpdateN (ToPeano n) (ToT pair), ToT (PairUpdateHs (ToPeano n) val pair) ~ UpdateN (ToPeano n) (ToT val) (ToT pair), SingIPeano n)
- type family PairUpdateHs (ix :: Peano) (val :: Type) (pair :: Type) :: Type where ...
- pairUpdate :: forall (n :: Nat) (val :: Type) (pair :: Type) (s :: [Type]). ConstraintPairUpdateLorentz n val pair => (val ': (pair ': s)) :-> (PairUpdateHs (ToPeano n) val pair ': s)
- failingWhenPresent :: forall c k s v st e. (MemOpHs c, k ~ MemOpKeyHs c, NiceConstant e, Dupable c, Dupable (MemOpKeyHs c), st ~ (k ': (v ': (c ': s)))) => (forall s0. (k ': s0) :-> (e ': s0)) -> st :-> st
- updateNew :: forall c k s e. (UpdOpHs c, GetOpHs c, k ~ UpdOpKeyHs c, k ~ GetOpKeyHs c, KnownValue (GetOpValHs c), NiceConstant e, Dupable k) => (forall s0. (k ': s0) :-> (e ': s0)) -> (k ': (UpdOpParamsHs c ': (c ': s))) :-> (c ': s)
- if_ :: (s :-> s') -> (s :-> s') -> (Bool ': s) :-> s'
- ifCons :: ((a ': (List a ': s)) :-> s') -> (s :-> s') -> (List a ': s) :-> s'
- loop :: (s :-> (Bool ': s)) -> (Bool ': s) :-> s
- loopLeft :: ((a ': s) :-> (Either a b ': s)) -> (Either a b ': s) :-> (b ': s)
- lambda :: ZipInstrs [i, o] => (IsNotInView => i :-> o) -> s :-> (WrappedLambda i o ': s)
- lambdaRec :: forall i o s. (ZipInstrs [i, o], KnownList i) => (IsNotInView => (i ++ '[WrappedLambda i o]) :-> o) -> s :-> (WrappedLambda i o ': s)
- exec :: (a ': (Lambda a b ': s)) :-> (b ': s)
- execute :: forall i o s. Each [KnownList, ZipInstr] [i, o] => (WrappedLambda i o ': (i ++ s)) :-> (o ++ s)
- apply :: forall a b c s. (NiceConstant a, KnownValue b) => (a ': (Lambda (a, b) c ': s)) :-> (Lambda b c ': s)
- applicate :: forall a b c inp2nd inpTail s. (NiceConstant a, ZipInstr b, b ~ (inp2nd ': inpTail)) => (a ': (WrappedLambda (a ': b) c ': s)) :-> (WrappedLambda b c ': s)
- dip :: forall a s s'. HasCallStack => (s :-> s') -> (a ': s) :-> (a ': s')
- type ConstraintDIPNLorentz (n :: Peano) (inp :: [Type]) (out :: [Type]) (s :: [Type]) (s' :: [Type]) = (ConstraintDIPN n (ToTs inp) (ToTs out) (ToTs s) (ToTs s'), ConstraintDIPN' Type n inp out s s', SingI n)
- dipNPeano :: forall (n :: Peano) (inp :: [Type]) (out :: [Type]) (s :: [Type]) (s' :: [Type]). ConstraintDIPNLorentz n inp out s s' => (s :-> s') -> inp :-> out
- dipN :: forall (n :: Nat) (inp :: [Type]) (out :: [Type]) (s :: [Type]) (s' :: [Type]). ConstraintDIPNLorentz (ToPeano n) inp out s s' => (s :-> s') -> inp :-> out
- failWith :: forall a s t. NiceConstant a => (a ': s) :-> t
- cast :: KnownValue a => (a ': s) :-> (a ': s)
- pack :: forall a s. NicePackedValue a => (a ': s) :-> (Packed a ': s)
- unpack :: forall a s. NiceUnpackedValue a => (Packed a ': s) :-> (Maybe a ': s)
- packRaw :: forall a s. NicePackedValue a => (a ': s) :-> (ByteString ': s)
- unpackRaw :: forall a s. NiceUnpackedValue a => (ByteString ': s) :-> (Maybe a ': s)
- concat :: ConcatOpHs c => (c ': (c ': s)) :-> (c ': s)
- concat' :: ConcatOpHs c => (List c ': s) :-> (c ': s)
- slice :: (SliceOpHs c, KnownValue c) => (Natural ': (Natural ': (c ': s))) :-> (Maybe c ': s)
- isNat :: (Integer ': s) :-> (Maybe Natural ': s)
- add :: ArithOpHs Add n m r => (n ': (m ': s)) :-> (r ': s)
- sub :: ArithOpHs Sub n m r => (n ': (m ': s)) :-> (r ': s)
- rsub :: ArithOpHs Sub n m r => (m ': (n ': s)) :-> (r ': s)
- mul :: ArithOpHs Mul n m r => (n ': (m ': s)) :-> (r ': s)
- ediv :: ArithOpHs EDiv n m r => (n ': (m ': s)) :-> (r ': s)
- abs :: UnaryArithOpHs Abs n => (n ': s) :-> (UnaryArithResHs Abs n ': s)
- subMutez :: (Mutez ': (Mutez ': s)) :-> (Maybe Mutez ': s)
- rsubMutez :: (Mutez ': (Mutez ': s)) :-> (Maybe Mutez ': s)
- neg :: UnaryArithOpHs Neg n => (n ': s) :-> (UnaryArithResHs Neg n ': s)
- lsl :: ArithOpHs Lsl n m r => (n ': (m ': s)) :-> (r ': s)
- lsr :: ArithOpHs Lsr n m r => (n ': (m ': s)) :-> (r ': s)
- or :: ArithOpHs Or n m r => (n ': (m ': s)) :-> (r ': s)
- and :: ArithOpHs And n m r => (n ': (m ': s)) :-> (r ': s)
- xor :: ArithOpHs Xor n m r => (n ': (m ': s)) :-> (r ': s)
- not :: UnaryArithOpHs Not n => (n ': s) :-> (UnaryArithResHs Not n ': s)
- compare :: NiceComparable n => (n ': (n ': s)) :-> (Integer ': s)
- eq0 :: UnaryArithOpHs Eq' n => (n ': s) :-> (UnaryArithResHs Eq' n ': s)
- neq0 :: UnaryArithOpHs Neq n => (n ': s) :-> (UnaryArithResHs Neq n ': s)
- lt0 :: UnaryArithOpHs Lt n => (n ': s) :-> (UnaryArithResHs Lt n ': s)
- gt0 :: UnaryArithOpHs Gt n => (n ': s) :-> (UnaryArithResHs Gt n ': s)
- le0 :: UnaryArithOpHs Le n => (n ': s) :-> (UnaryArithResHs Le n ': s)
- ge0 :: UnaryArithOpHs Ge n => (n ': s) :-> (UnaryArithResHs Ge n ': s)
- int :: ToIntegerArithOpHs i => (i ': s) :-> (Integer ': s)
- nat :: BytesLike bs => (bs ': s) :-> (Natural ': s)
- bytes :: (BytesLike bs, ToBytesArithOpHs i) => (i ': s) :-> (bs ': s)
- toTAddress_ :: forall cp addr vd s. ToTAddress_ cp vd addr => (addr ': s) :-> (TAddress cp vd ': s)
- view' :: forall name ret arg s. (HasCallStack, KnownSymbol name, KnownValue arg, NiceViewable ret) => (arg ': (Address ': s)) :-> (Maybe ret ': s)
- self :: forall p s. (NiceParameterFull p, ForbidExplicitDefaultEntrypoint p, IsNotInView) => s :-> (ContractRef p ': s)
- selfCalling :: forall p mname s. (NiceParameterFull p, IsNotInView) => EntrypointRef mname -> s :-> (ContractRef (GetEntrypointArgCustom p mname) ': s)
- contract :: forall p vd addr s. (NiceParameterFull p, ForbidExplicitDefaultEntrypoint p, ToTAddress_ p vd addr) => (addr ': s) :-> (Maybe (ContractRef p) ': s)
- contractCalling :: forall cp epRef epArg addr vd s. (HasEntrypointArg cp epRef epArg, ToTAddress_ cp vd addr) => epRef -> (addr ': s) :-> (Maybe (ContractRef epArg) ': s)
- unsafeContractCalling :: forall arg s. NiceParameter arg => EpName -> (Address ': s) :-> (Maybe (ContractRef arg) ': s)
- runFutureContract :: forall p s. NiceParameter p => (FutureContract p ': s) :-> (Maybe (ContractRef p) ': s)
- epAddressToContract :: forall p s. NiceParameter p => (EpAddress ': s) :-> (Maybe (ContractRef p) ': s)
- transferTokens :: forall p s. (NiceParameter p, IsNotInView) => (p ': (Mutez ': (ContractRef p ': s))) :-> (Operation ': s)
- setDelegate :: IsNotInView => (Maybe KeyHash ': s) :-> (Operation ': s)
- createContract :: forall p g vd s. IsNotInView => Contract p g vd -> (Maybe KeyHash ': (Mutez ': (g ': s))) :-> (Operation ': (TAddress p vd ': s))
- implicitAccount :: (KeyHash ': s) :-> (ContractRef () ': s)
- now :: s :-> (Timestamp ': s)
- minBlockTime :: s :-> (Natural ': s)
- amount :: s :-> (Mutez ': s)
- balance :: s :-> (Mutez ': s)
- votingPower :: (KeyHash ': s) :-> (Natural ': s)
- totalVotingPower :: s :-> (Natural ': s)
- checkSignature :: BytesLike bs => (PublicKey ': (TSignature bs ': (bs ': s))) :-> (Bool ': s)
- sha256 :: BytesLike bs => (bs ': s) :-> (Hash Sha256 bs ': s)
- sha512 :: BytesLike bs => (bs ': s) :-> (Hash Sha512 bs ': s)
- blake2B :: BytesLike bs => (bs ': s) :-> (Hash Blake2b bs ': s)
- sha3 :: BytesLike bs => (bs ': s) :-> (Hash Sha3 bs ': s)
- keccak :: BytesLike bs => (bs ': s) :-> (Hash Keccak bs ': s)
- hashKey :: (PublicKey ': s) :-> (KeyHash ': s)
- pairingCheck :: ([(Bls12381G1, Bls12381G2)] ': s) :-> (Bool ': s)
- source :: s :-> (Address ': s)
- sender :: s :-> (Address ': s)
- address :: (ContractRef a ': s) :-> (Address ': s)
- selfAddress :: s :-> (Address ': s)
- ticket :: NiceComparable a => (a ': (Natural ': s)) :-> (Maybe (Ticket a) ': s)
- data ReadTicket a
- readTicket :: (Ticket a ': s) :-> (ReadTicket a ': (Ticket a ': s))
- splitTicket :: (Ticket a ': ((Natural, Natural) ': s)) :-> (Maybe (Ticket a, Ticket a) ': s)
- splitTicketNamed :: forall n1 n2 a s. (Ticket a ': ((n1 :! Natural, n2 :! Natural) ': s)) :-> (Maybe (n1 :! Ticket a, n2 :! Ticket a) ': s)
- joinTickets :: ((Ticket a, Ticket a) ': s) :-> (Maybe (Ticket a) ': s)
- openChest :: (ChestKey ': (Chest ': (Natural ': s))) :-> (OpenChest ': s)
- chainId :: s :-> (ChainId ': s)
- level :: s :-> (Natural ': s)
- never :: (Never ': s) :-> s'
- framed :: forall s i o. (KnownList i, KnownList o) => (i :-> o) -> (i ++ s) :-> (o ++ s)
- emit :: forall t s. (NicePackedValue t, HasAnnotation t) => FieldAnn -> (t ': s) :-> (Operation ': s)
- emit' :: forall t s. NicePackedValue t => FieldAnn -> Maybe (Notes (ToT t)) -> (t ': s) :-> (Operation ': s)
- emitAuto :: forall t s. NicePackedValue t => FieldAnn -> (t ': s) :-> (Operation ': s)
- class LorentzFunctor (c :: Type -> Type) a b where
- lmap :: KnownValue b => ('[a] :-> '[b]) -> (c a ': s) :-> (c b ': s)
Documentation
dropN :: forall (n :: Nat) (s :: [Type]). (SingIPeano n, RequireLongerOrSameLength (ToTs s) (ToPeano n), Drop (ToPeano n) (ToTs s) ~ ToTs (Drop (ToPeano n) s)) => s :-> Drop (ToPeano n) s Source #
Drop top n
elements from the stack.
type ConstraintDUPNLorentz (n :: Peano) (inp :: [Type]) (out :: [Type]) (a :: Type) = (ConstraintDUPN n (ToTs inp) (ToTs out) (ToT a), ConstraintDUPN' Type n inp out a, SingI n) Source #
dup :: forall a s. Dupable a => (a ': s) :-> (a ': (a ': s)) Source #
Copies a stack argument.
Hit the Dupable
constraint?
Polymorphism and abstractions do not play very well with this constraint,
you can enjoy suffering from the linear types feature under various sauces:
- The most trivial option is to just propagate
Dupable
constraint when you want to usedup
, this suits for case when you are not planning to work with non-dupable types like tickets. - Sometimes it is possible to avoid
dup
and use other instructions instead (e.g.unpair
allows splitting a pair without usingdup
s,getAndUpdate
allows accessing a map value without implicit duplication). But you may have to learn to write code in a completely different way, and the result may be less efficient comparing to the option with usingdup
. - Use
decideOnDupable
to provide two code paths - when type is dupable and when it is not.
dupNPeano :: forall (n :: Peano) a inp out. (ConstraintDUPNLorentz n inp out a, Dupable a) => inp :-> out Source #
dupN :: forall (n :: Nat) a inp out. (ConstraintDUPNLorentz (ToPeano n) inp out a, Dupable a) => inp :-> out Source #
type ConstraintDIGLorentz (n :: Peano) (inp :: [Type]) (out :: [Type]) (a :: Type) = (ConstraintDIG n (ToTs inp) (ToTs out) (ToT a), ConstraintDIG' Type n inp out a, SingI n) Source #
digPeano :: forall (n :: Peano) inp out a. ConstraintDIGLorentz n inp out a => inp :-> out Source #
Version of dig
which uses Peano number.
It is intended for internal usage in Lorentz.
dig :: forall (n :: Nat) inp out a. ConstraintDIGLorentz (ToPeano n) inp out a => inp :-> out Source #
type ConstraintDUGLorentz (n :: Peano) (inp :: [Type]) (out :: [Type]) (a :: Type) = (ConstraintDUG n (ToTs inp) (ToTs out) (ToT a), ConstraintDUG' Type n inp out a, SingI n) Source #
dugPeano :: forall (n :: Peano) inp out a. ConstraintDUGLorentz n inp out a => inp :-> out Source #
Version of dug
which uses Peano number.
It is intended for internal usage in Lorentz.
dug :: forall (n :: Nat) inp out a. ConstraintDUGLorentz (ToPeano n) inp out a => inp :-> out Source #
push :: forall t s. NiceConstant t => t -> s :-> (t ': s) Source #
emptyMap :: (NiceComparable k, KnownValue v) => s :-> (Map k v ': s) Source #
emptyBigMap :: (NiceComparable k, KnownValue v, NiceNoBigMap v) => s :-> (BigMap k v ': s) Source #
map :: (MapOpHs c, IsoMapOpRes c b, KnownValue b, HasCallStack) => ((MapOpInpHs c ': s) :-> (b ': s)) -> (c ': s) :-> (MapOpResHs c b ': s) Source #
iter :: (IterOpHs c, HasCallStack) => ((IterOpElHs c ': s) :-> s) -> (c ': s) :-> s Source #
get :: (GetOpHs c, KnownValue (GetOpValHs c)) => (GetOpKeyHs c ': (c ': s)) :-> (Maybe (GetOpValHs c) ': s) Source #
type ConstraintPairGetLorentz (n :: Nat) (pair :: Type) = (ConstraintGetN (ToPeano n) (ToT pair), ToT (PairGetHs (ToPeano n) pair) ~ GetN (ToPeano n) (ToT pair), SingIPeano n) Source #
pairGet :: forall (n :: Nat) (pair :: Type) (s :: [Type]). ConstraintPairGetLorentz n pair => (pair ': s) :-> (PairGetHs (ToPeano n) pair ': s) Source #
update :: UpdOpHs c => (UpdOpKeyHs c ': (UpdOpParamsHs c ': (c ': s))) :-> (c ': s) Source #
getAndUpdate :: (GetOpHs c, UpdOpHs c, KnownValue (GetOpValHs c), UpdOpKeyHs c ~ GetOpKeyHs c) => (UpdOpKeyHs c ': (UpdOpParamsHs c ': (c ': s))) :-> (Maybe (GetOpValHs c) ': (c ': s)) Source #
type ConstraintPairUpdateLorentz (n :: Nat) (val :: Type) (pair :: Type) = (ConstraintUpdateN (ToPeano n) (ToT pair), ToT (PairUpdateHs (ToPeano n) val pair) ~ UpdateN (ToPeano n) (ToT val) (ToT pair), SingIPeano n) Source #
type family PairUpdateHs (ix :: Peano) (val :: Type) (pair :: Type) :: Type where ... Source #
PairUpdateHs 'Z val _ = val | |
PairUpdateHs ('S 'Z) val (_, right) = (val, right) | |
PairUpdateHs ('S ('S n)) val (left, right) = (left, PairUpdateHs n val right) |
pairUpdate :: forall (n :: Nat) (val :: Type) (pair :: Type) (s :: [Type]). ConstraintPairUpdateLorentz n val pair => (val ': (pair ': s)) :-> (PairUpdateHs (ToPeano n) val pair ': s) Source #
failingWhenPresent :: forall c k s v st e. (MemOpHs c, k ~ MemOpKeyHs c, NiceConstant e, Dupable c, Dupable (MemOpKeyHs c), st ~ (k ': (v ': (c ': s)))) => (forall s0. (k ': s0) :-> (e ': s0)) -> st :-> st Source #
Helper instruction.
Checks whether given key present in the storage and fails if it is. This instruction leaves stack intact.
updateNew :: forall c k s e. (UpdOpHs c, GetOpHs c, k ~ UpdOpKeyHs c, k ~ GetOpKeyHs c, KnownValue (GetOpValHs c), NiceConstant e, Dupable k) => (forall s0. (k ': s0) :-> (e ': s0)) -> (k ': (UpdOpParamsHs c ': (c ': s))) :-> (c ': s) Source #
Like update
, but throw an error on attempt to overwrite existing entry.
lambda :: ZipInstrs [i, o] => (IsNotInView => i :-> o) -> s :-> (WrappedLambda i o ': s) Source #
lambdaRec :: forall i o s. (ZipInstrs [i, o], KnownList i) => (IsNotInView => (i ++ '[WrappedLambda i o]) :-> o) -> s :-> (WrappedLambda i o ': s) Source #
execute :: forall i o s. Each [KnownList, ZipInstr] [i, o] => (WrappedLambda i o ': (i ++ s)) :-> (o ++ s) Source #
Similar to exec
but works for lambdas with arbitrary size of input
and output.
Note that this instruction has its arguments flipped, lambda goes first. This seems to be the only reasonable way to achieve good inference.
apply :: forall a b c s. (NiceConstant a, KnownValue b) => (a ': (Lambda (a, b) c ': s)) :-> (Lambda b c ': s) Source #
applicate :: forall a b c inp2nd inpTail s. (NiceConstant a, ZipInstr b, b ~ (inp2nd ': inpTail)) => (a ': (WrappedLambda (a ': b) c ': s)) :-> (WrappedLambda b c ': s) Source #
Version of apply
that works for lambdas with arbitrary length
input and output.
type ConstraintDIPNLorentz (n :: Peano) (inp :: [Type]) (out :: [Type]) (s :: [Type]) (s' :: [Type]) = (ConstraintDIPN n (ToTs inp) (ToTs out) (ToTs s) (ToTs s'), ConstraintDIPN' Type n inp out s s', SingI n) Source #
dipNPeano :: forall (n :: Peano) (inp :: [Type]) (out :: [Type]) (s :: [Type]) (s' :: [Type]). ConstraintDIPNLorentz n inp out s s' => (s :-> s') -> inp :-> out Source #
Version of dipN
which uses Peano number.
It is intended for internal usage in Lorentz.
dipN :: forall (n :: Nat) (inp :: [Type]) (out :: [Type]) (s :: [Type]) (s' :: [Type]). ConstraintDIPNLorentz (ToPeano n) inp out s s' => (s :-> s') -> inp :-> out Source #
failWith :: forall a s t. NiceConstant a => (a ': s) :-> t Source #
cast :: KnownValue a => (a ': s) :-> (a ': s) Source #
packRaw :: forall a s. NicePackedValue a => (a ': s) :-> (ByteString ': s) Source #
unpackRaw :: forall a s. NiceUnpackedValue a => (ByteString ': s) :-> (Maybe a ': s) Source #
concat :: ConcatOpHs c => (c ': (c ': s)) :-> (c ': s) Source #
slice :: (SliceOpHs c, KnownValue c) => (Natural ': (Natural ': (c ': s))) :-> (Maybe c ': s) Source #
abs :: UnaryArithOpHs Abs n => (n ': s) :-> (UnaryArithResHs Abs n ': s) Source #
neg :: UnaryArithOpHs Neg n => (n ': s) :-> (UnaryArithResHs Neg n ': s) Source #
not :: UnaryArithOpHs Not n => (n ': s) :-> (UnaryArithResHs Not n ': s) Source #
eq0 :: UnaryArithOpHs Eq' n => (n ': s) :-> (UnaryArithResHs Eq' n ': s) Source #
neq0 :: UnaryArithOpHs Neq n => (n ': s) :-> (UnaryArithResHs Neq n ': s) Source #
lt0 :: UnaryArithOpHs Lt n => (n ': s) :-> (UnaryArithResHs Lt n ': s) Source #
gt0 :: UnaryArithOpHs Gt n => (n ': s) :-> (UnaryArithResHs Gt n ': s) Source #
le0 :: UnaryArithOpHs Le n => (n ': s) :-> (UnaryArithResHs Le n ': s) Source #
ge0 :: UnaryArithOpHs Ge n => (n ': s) :-> (UnaryArithResHs Ge n ': s) Source #
toTAddress_ :: forall cp addr vd s. ToTAddress_ cp vd addr => (addr ': s) :-> (TAddress cp vd ': s) Source #
Cast something appropriate to TAddress
.
view' :: forall name ret arg s. (HasCallStack, KnownSymbol name, KnownValue arg, NiceViewable ret) => (arg ': (Address ': s)) :-> (Maybe ret ': s) Source #
Manual variation of VIEW
instruction.
It is pretty much like Michelson's VIEW
, you must make sure that the compiler can
infer the argument and return types of the view.
In most cases prefer view
instead.
self :: forall p s. (NiceParameterFull p, ForbidExplicitDefaultEntrypoint p, IsNotInView) => s :-> (ContractRef p ': s) Source #
Get a reference to the current contract.
Note that, similar to CONTRACT
instruction, in Michelson SELF
instruction
can accept an entrypoint as field annotation, and without annotation specified
it creates a contract
value which calls the default entrypoint.
This particular function carries the behaviour of SELF
before introduction
of lightweight entrypoints feature.
Thus the contract must not have explicit "default" entrypoint for this to
work.
If you are going to call a specific entrypoint of the contract, see selfCalling
.
selfCalling :: forall p mname s. (NiceParameterFull p, IsNotInView) => EntrypointRef mname -> s :-> (ContractRef (GetEntrypointArgCustom p mname) ': s) Source #
Make a reference to the current contract, maybe a specific entrypoint.
Note that, since information about parameter of the current contract is not
carried around, in this function you need to specify parameter type p
explicitly.
contract :: forall p vd addr s. (NiceParameterFull p, ForbidExplicitDefaultEntrypoint p, ToTAddress_ p vd addr) => (addr ': s) :-> (Maybe (ContractRef p) ': s) Source #
Get a reference to a contract by its address.
This instruction carries the behaviour of CONTRACT
before introduction
of lightweight entrypoints feature.
The contract must not have explicit "default" entrypoint for this to work.
If you are going to call a specific entrypoint of the contract, see contractCalling
.
contractCalling :: forall cp epRef epArg addr vd s. (HasEntrypointArg cp epRef epArg, ToTAddress_ cp vd addr) => epRef -> (addr ': s) :-> (Maybe (ContractRef epArg) ': s) Source #
Make a reference to a contract, maybe a specific entrypoint.
When calling this function, make sure that parameter type is known.
It's recommended that you supply TAddress
with a concrete parameter as the
stack argument.
unsafeContractCalling :: forall arg s. NiceParameter arg => EpName -> (Address ': s) :-> (Maybe (ContractRef arg) ': s) Source #
Specialized version of contractCalling
for the case when you do
not have compile-time evidence of appropriate HasEntrypointArg
.
For instance, if you have untyped EpName
you can not have this
evidence (the value is only available in runtime).
If you have typed EntrypointRef
, use eprName
to construct EpName
.
runFutureContract :: forall p s. NiceParameter p => (FutureContract p ': s) :-> (Maybe (ContractRef p) ': s) Source #
Version of contract
instruction which may accept address with already
specified entrypoint name.
Also you cannot specify entrypoint name here because this could result in conflict.
epAddressToContract :: forall p s. NiceParameter p => (EpAddress ': s) :-> (Maybe (ContractRef p) ': s) Source #
Similar to runFutureContract
, works with EpAddress
.
Validity of such operation cannot be ensured at compile time.
transferTokens :: forall p s. (NiceParameter p, IsNotInView) => (p ': (Mutez ': (ContractRef p ': s))) :-> (Operation ': s) Source #
setDelegate :: IsNotInView => (Maybe KeyHash ': s) :-> (Operation ': s) Source #
createContract :: forall p g vd s. IsNotInView => Contract p g vd -> (Maybe KeyHash ': (Mutez ': (g ': s))) :-> (Operation ': (TAddress p vd ': s)) Source #
implicitAccount :: (KeyHash ': s) :-> (ContractRef () ': s) Source #
minBlockTime :: s :-> (Natural ': s) Source #
totalVotingPower :: s :-> (Natural ': s) Source #
checkSignature :: BytesLike bs => (PublicKey ': (TSignature bs ': (bs ': s))) :-> (Bool ': s) Source #
pairingCheck :: ([(Bls12381G1, Bls12381G2)] ': s) :-> (Bool ': s) Source #
selfAddress :: s :-> (Address ': s) Source #
data ReadTicket a Source #
Value returned by READ_TICKET
instruction.
Instances
readTicket :: (Ticket a ': s) :-> (ReadTicket a ': (Ticket a ': s)) Source #
Note: for more advanced helpers for tickets see Lorentz.Tickets module.
splitTicket :: (Ticket a ': ((Natural, Natural) ': s)) :-> (Maybe (Ticket a, Ticket a) ': s) Source #
Note: for more advanced helpers for tickets see Lorentz.Tickets module.
splitTicketNamed :: forall n1 n2 a s. (Ticket a ': ((n1 :! Natural, n2 :! Natural) ': s)) :-> (Maybe (n1 :! Ticket a, n2 :! Ticket a) ': s) Source #
Version of splitTicket
with entries named.
joinTickets :: ((Ticket a, Ticket a) ': s) :-> (Maybe (Ticket a) ': s) Source #
Note: for more advanced helpers for tickets see Lorentz.Tickets module.
openChest :: (ChestKey ': (Chest ': (Natural ': s))) :-> (OpenChest ': s) Source #
Deprecated: Due to a vulnerability discovered in time-lock protocol, OPEN_CHEST is temporarily deprecated since Lima
framed :: forall s i o. (KnownList i, KnownList o) => (i :-> o) -> (i ++ s) :-> (o ++ s) Source #
Execute given instruction on truncated stack.
This instruction requires you to specify the piece of stack to truncate as type argument.
The complexity of this operation is linear in the number of instructions. If possible, avoid nested uses as that would imply multiple traversals. Worst case, complexity can become quadratic.
emit :: forall t s. (NicePackedValue t, HasAnnotation t) => FieldAnn -> (t ': s) :-> (Operation ': s) Source #
Version of emit
that adds the type annotation, only when t
has annotations.
emit' :: forall t s. NicePackedValue t => FieldAnn -> Maybe (Notes (ToT t)) -> (t ': s) :-> (Operation ': s) Source #
emitAuto :: forall t s. NicePackedValue t => FieldAnn -> (t ': s) :-> (Operation ': s) Source #
Version of emit
that omits the type annotation, letting the runtime infer
it instead.
class LorentzFunctor (c :: Type -> Type) a b where Source #
Instances
(NiceComparable a, NiceComparable b) => LorentzFunctor Set a b Source # | |
Defined in Lorentz.Instr | |
LorentzFunctor Maybe a b Source # | |
Defined in Lorentz.Instr | |
LorentzFunctor [] a b Source # | |
Defined in Lorentz.Instr | |
KnownValue a => LorentzFunctor (Either a) a b Source # | |
Defined in Lorentz.Instr | |
NiceComparable k => LorentzFunctor (Map k) a b Source # | |
Defined in Lorentz.Instr |