lorentz-0.13.1: EDSL for the Michelson Language
Safe HaskellNone
LanguageHaskell2010

Lorentz.Constraints.Scopes

Description

Scope-related constraints used in Lorentz.

This contains constraints from Morley.Michelson.Typed.Scope modified for use in Lorentz.

Synopsis

Grouped constraints

type NiceComparable n = (ProperNonComparableValBetterErrors (ToT n), KnownValue n, Comparable (ToT n)) Source #

Constraint applied to any type, to check if Michelson representation (if exists) of this type is Comparable. In case it is not prints human-readable error message

type NiceConstant a = (ProperConstantBetterErrors (ToT a), KnownValue a) Source #

type Dupable a = (ProperDupableBetterErrors (ToT a), KnownValue a) Source #

type NicePackedValue a = (ProperPackedValBetterErrors (ToT a), KnownValue a) Source #

type NiceParameter a = (ProperParameterBetterErrors (ToT a), KnownValue a) Source #

Constraint applied to any part of parameter type.

Note that you don't usually apply this constraint to the whole parameter, consider using NiceParameterFull in such case.

Using this type is justified e.g. when calling another contract, there you usually supply an entrypoint argument, not the whole parameter.

type NiceUntypedValue a = (ProperUntypedValBetterErrors (ToT a), KnownValue a) Source #

type NiceStorage a = (ProperStorageBetterErrors (ToT a), HasAnnotation a, KnownValue a) Source #

type NiceUnpackedValue a = (ProperUnpackedValBetterErrors (ToT a), KnownValue a) Source #

type NiceViewable a = (ProperViewableBetterErrors (ToT a), KnownValue a) Source #

type NiceNoBigMap n = (KnownValue n, HasNoBigMap (ToT n)) Source #

niceParameterEvi :: forall a. NiceParameter a :- ParameterScope (ToT a) Source #

niceStorageEvi :: forall a. NiceStorage a :- StorageScope (ToT a) Source #

dupableEvi :: forall a. Dupable a :- DupableScope (ToT a) Source #

nicePackedValueEvi :: forall a. NicePackedValue a :- PackedValScope (ToT a) Source #

niceUnpackedValueEvi :: forall a. NiceUnpackedValue a :- UnpackedValScope (ToT a) Source #

niceUntypedValueEvi :: forall a. NiceUntypedValue a :- UntypedValScope (ToT a) Source #

niceViewableEvi :: forall a. NiceViewable a :- ViewableScope (ToT a) Source #

Individual constraints (internals)

class (HasNoNestedBigMaps (ToT a), IsoValue a) => CanHaveBigMap a Source #

Instances

Instances details
(HasNoNestedBigMaps (ToT a), IsoValue a) => CanHaveBigMap a Source # 
Instance details

Defined in Lorentz.Constraints.Scopes

class (IsoValue a, Typeable a) => KnownValue a Source #

Gathers constraints, commonly required for values.

Instances

Instances details
(IsoValue a, Typeable a) => KnownValue a Source # 
Instance details

Defined in Lorentz.Constraints.Scopes

class (ForbidOp (ToT a), IsoValue a) => NoOperation a Source #

Ensure given type does not contain "operation".

Instances

Instances details
(ForbidOp (ToT a), IsoValue a) => NoOperation a Source # 
Instance details

Defined in Lorentz.Constraints.Scopes

class (ForbidContract (ToT a), IsoValue a) => NoContractType a Source #

Instances

Instances details
(ForbidContract (ToT a), IsoValue a) => NoContractType a Source # 
Instance details

Defined in Lorentz.Constraints.Scopes

class (ForbidBigMap (ToT a), IsoValue a) => NoBigMap a Source #

Instances

Instances details
(ForbidBigMap (ToT a), IsoValue a) => NoBigMap a Source # 
Instance details

Defined in Lorentz.Constraints.Scopes

Re-exports

withDict :: HasDict c e => e -> (c => r) -> r #

From a Dict, takes a value in an environment where the instance witnessed by the Dict is in scope, and evaluates it.

Essentially a deconstruction of a Dict into its continuation-style form.

Can also be used to deconstruct an entailment, a :- b, using a context a.

withDict :: Dict c -> (c => r) -> r
withDict :: a => (a :- c) -> (c => r) -> r