morley-0.3.0: Developer tools for the Michelson Language

Safe HaskellNone
LanguageHaskell2010

Michelson.Typed.Scope

Description

Module, containing restrictions imposed by instruction or value scope.

Synopsis

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

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

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 #

Constructors

ContainsBigMap t ~ True => BigMapPresent 
ContainsBigMap t ~ False => BigMapAbsent 

data OpPresence (t :: T) Source #

Whether the type contains TOperation, with proof.

Constructors

ContainsOp t ~ True => OpPresent 
ContainsOp t ~ False => OpAbsent 

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

forbiddenOp :: forall t a. (SingI t, ForbidOp t) => (HasNoOp t => a) -> a Source #

Reify HasNoOp contraint from ForbidOp.

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