Safe Haskell | None |
---|---|
Language | Haskell2010 |
Module, containing restrictions imposed by instruction or value scope.
Synopsis
- type AllowBigMap t = FailOnBigMapFound (BadBigMapPair t)
- class ContainsBigMap t ~ False => HasNoBigMap t
- class ContainsOp t ~ False => HasNoOp t
- type ForbidBigMap t = FailOnBigMapFound (ContainsBigMap t)
- type ForbidOp t = FailOnOperationFound (ContainsOp t)
- data BigMapPresence (t :: T)
- = ContainsBigMap t ~ True => BigMapPresent
- | ContainsBigMap t ~ False => BigMapAbsent
- data OpPresence (t :: T)
- type BigMapConstraint t = BadBigMapPair t ~ False
- checkOpPresence :: Sing (ty :: T) -> OpPresence ty
- checkBigMapPresence :: Sing (ty :: T) -> BigMapPresence ty
- checkBigMapConstraint :: forall t a. (SingI t, AllowBigMap t) => (BigMapConstraint t => a) -> a
- opAbsense :: Sing (t :: T) -> Maybe (Dict $ HasNoOp t)
- bigMapAbsense :: Sing (t :: T) -> Maybe (Dict $ HasNoBigMap t)
- forbiddenOp :: forall t a. (SingI t, ForbidOp t) => (HasNoOp t => a) -> a
- forbiddenBigMap :: forall t a. (SingI t, ForbidBigMap t) => (HasNoBigMap t => a) -> a
- bigMapConstrained :: Sing (t :: T) -> Maybe (Dict $ BigMapConstraint t)
Documentation
type AllowBigMap t = FailOnBigMapFound (BadBigMapPair t) Source #
class ContainsBigMap t ~ False => HasNoBigMap t Source #
Constraint which ensures that bigmap does not appear in a given type.
Instances
ContainsBigMap t ~ False => HasNoBigMap t Source # | |
Defined in Michelson.Typed.Scope |
class ContainsOp t ~ False => HasNoOp t Source #
Constraint which ensures that operation type does not appear in a given type.
Not just a type alias in order to be able to partially apply it
(e.g. in Each
).
Instances
ContainsOp t ~ False => HasNoOp t Source # | |
Defined in Michelson.Typed.Scope |
type ForbidBigMap t = FailOnBigMapFound (ContainsBigMap t) Source #
type ForbidOp t = FailOnOperationFound (ContainsOp t) Source #
This is like HasNoOp
, it raises a more human-readable error
when t
type is concrete, but you cannot easily extract a proof
of no-operation-presence from it.
Use it in our eDSL.
data BigMapPresence (t :: T) Source #
ContainsBigMap t ~ True => BigMapPresent | |
ContainsBigMap t ~ False => BigMapAbsent |
data OpPresence (t :: T) Source #
Whether the type contains TOperation
, with proof.
type BigMapConstraint t = BadBigMapPair t ~ False Source #
Constraint which ensures, that t
can be used as type of contract storage
so it optionally has bigmap only on the left of its toplevel pair
checkOpPresence :: Sing (ty :: T) -> OpPresence ty Source #
Check at runtime whether the given type contains TOperation
.
checkBigMapPresence :: Sing (ty :: T) -> BigMapPresence ty Source #
Check at runtime whether the given type contains TBigMap
.
checkBigMapConstraint :: forall t a. (SingI t, AllowBigMap t) => (BigMapConstraint t => a) -> a Source #
opAbsense :: Sing (t :: T) -> Maybe (Dict $ HasNoOp t) Source #
Check at runtime that the given type does not contain TOperation
.
bigMapAbsense :: Sing (t :: T) -> Maybe (Dict $ HasNoBigMap t) Source #
Check at runtime that the given type does not containt TBigMap
forbiddenBigMap :: forall t a. (SingI t, ForbidBigMap t) => (HasNoBigMap t => a) -> a Source #
bigMapConstrained :: Sing (t :: T) -> Maybe (Dict $ BigMapConstraint t) Source #
Check at runtime that the given type optionally has bigmap only on the left of its toplevel pair, which is actuall constraint for bigmap appearance in the storage