{-# LANGUAGE UndecidableSuperClasses #-}
module Lorentz.Constraints.Scopes
(
NiceComparable
, NiceConstant
, NiceFullPackedValue
, NicePackedValue
, NiceParameter
, NicePrintedValue
, NiceStorage
, NiceUnpackedValue
, niceParameterEvi
, niceStorageEvi
, niceConstantEvi
, nicePackedValueEvi
, niceUnpackedValueEvi
, nicePrintedValueEvi
, CanHaveBigMap
, KnownValue
, NoOperation
, NoContractType
, NoBigMap
,
withDict
) where
import Data.Constraint (evidence, trans, weaken2)
import Lorentz.Annotation (HasAnnotation)
import Michelson.Typed
class (IsoValue a, Typeable a) => KnownValue a
instance (IsoValue a, Typeable a) => KnownValue a
class (IsoValue a, ForbidOp (ToT a)) => NoOperation a
instance (IsoValue a, ForbidOp (ToT a)) => NoOperation a
class (IsoValue a, ForbidContract (ToT a)) => NoContractType a
instance (IsoValue a, ForbidContract (ToT a)) => NoContractType a
class (IsoValue a, ForbidBigMap (ToT a)) => NoBigMap a
instance (IsoValue a, ForbidBigMap (ToT a)) => NoBigMap a
class (IsoValue a, HasNoNestedBigMaps (ToT a)) => CanHaveBigMap a
instance (IsoValue a, HasNoNestedBigMaps (ToT a)) => CanHaveBigMap a
type NiceParameter a = (KnownValue a, ProperParameterBetterErrors (ToT a))
type NiceStorage a =
(HasAnnotation a, KnownValue a, ProperStorageBetterErrors (ToT a))
type NiceConstant a = (KnownValue a, ProperConstantBetterErrors (ToT a))
type NicePackedValue a = (KnownValue a, ProperPackedValBetterErrors (ToT a))
type NiceUnpackedValue a = (KnownValue a, ProperUnpackedValBetterErrors (ToT a))
type NiceFullPackedValue a = (NicePackedValue a, NiceUnpackedValue a)
type NicePrintedValue a = (KnownValue a, ProperPrintedValBetterErrors (ToT a))
type NiceComparable n = (KnownValue n, Comparable (ToT n))
niceParameterEvi :: forall a. NiceParameter a :- ParameterScope (ToT a)
niceParameterEvi :: NiceParameter a :- ParameterScope (ToT a)
niceParameterEvi =
ProperParameterBetterErrors (ToT a) :- ParameterScope (ToT a)
forall (t :: T). ProperParameterBetterErrors t :- ParameterScope t
properParameterEvi @(ToT a) (ProperParameterBetterErrors (ToT a) :- ParameterScope (ToT a))
-> (NiceParameter a :- ProperParameterBetterErrors (ToT a))
-> NiceParameter a :- ParameterScope (ToT a)
forall (b :: Constraint) (c :: Constraint) (a :: Constraint).
(b :- c) -> (a :- b) -> a :- c
`trans` NiceParameter a :- ProperParameterBetterErrors (ToT a)
forall (a :: Constraint) (b :: Constraint). (a, b) :- b
weaken2
niceStorageEvi :: forall a. NiceStorage a :- StorageScope (ToT a)
niceStorageEvi :: NiceStorage a :- StorageScope (ToT a)
niceStorageEvi =
(NiceStorage a => Dict (StorageScope (ToT a)))
-> NiceStorage a :- StorageScope (ToT a)
forall (a :: Constraint) (b :: Constraint). (a => Dict b) -> a :- b
Sub (((KnownT (ToT a), FailOnOperationFound (ContainsOp (ToT a)),
FailOnNestedBigMapsFound (ContainsNestedBigMaps (ToT a)),
FailOnContractFound (ContainsContract (ToT a)))
:- StorageScope (ToT a))
-> Dict (StorageScope (ToT a))
forall (c :: Constraint) e. HasDict c e => e -> Dict c
evidence (((KnownT (ToT a), FailOnOperationFound (ContainsOp (ToT a)),
FailOnNestedBigMapsFound (ContainsNestedBigMaps (ToT a)),
FailOnContractFound (ContainsContract (ToT a)))
:- StorageScope (ToT a))
-> Dict (StorageScope (ToT a)))
-> ((KnownT (ToT a), FailOnOperationFound (ContainsOp (ToT a)),
FailOnNestedBigMapsFound (ContainsNestedBigMaps (ToT a)),
FailOnContractFound (ContainsContract (ToT a)))
:- StorageScope (ToT a))
-> Dict (StorageScope (ToT a))
forall a b. (a -> b) -> a -> b
$ (KnownT (ToT a), FailOnOperationFound (ContainsOp (ToT a)),
FailOnNestedBigMapsFound (ContainsNestedBigMaps (ToT a)),
FailOnContractFound (ContainsContract (ToT a)))
:- StorageScope (ToT a)
forall (t :: T). ProperStorageBetterErrors t :- StorageScope t
properStorageEvi @(ToT a))
niceConstantEvi :: forall a. NiceConstant a :- ConstantScope (ToT a)
niceConstantEvi :: NiceConstant a :- ConstantScope (ToT a)
niceConstantEvi =
ProperConstantBetterErrors (ToT a) :- ConstantScope (ToT a)
forall (t :: T). ProperConstantBetterErrors t :- ConstantScope t
properConstantEvi @(ToT a) (ProperConstantBetterErrors (ToT a) :- ConstantScope (ToT a))
-> (NiceConstant a :- ProperConstantBetterErrors (ToT a))
-> NiceConstant a :- ConstantScope (ToT a)
forall (b :: Constraint) (c :: Constraint) (a :: Constraint).
(b :- c) -> (a :- b) -> a :- c
`trans` NiceConstant a :- ProperConstantBetterErrors (ToT a)
forall (a :: Constraint) (b :: Constraint). (a, b) :- b
weaken2
nicePackedValueEvi :: forall a. NicePackedValue a :- PackedValScope (ToT a)
nicePackedValueEvi :: NicePackedValue a :- PackedValScope (ToT a)
nicePackedValueEvi =
ProperPackedValBetterErrors (ToT a) :- PackedValScope (ToT a)
forall (t :: T). ProperPackedValBetterErrors t :- PackedValScope t
properPackedValEvi @(ToT a) (ProperPackedValBetterErrors (ToT a) :- PackedValScope (ToT a))
-> (NicePackedValue a :- ProperPackedValBetterErrors (ToT a))
-> NicePackedValue a :- PackedValScope (ToT a)
forall (b :: Constraint) (c :: Constraint) (a :: Constraint).
(b :- c) -> (a :- b) -> a :- c
`trans` NicePackedValue a :- ProperPackedValBetterErrors (ToT a)
forall (a :: Constraint) (b :: Constraint). (a, b) :- b
weaken2
niceUnpackedValueEvi :: forall a. NiceUnpackedValue a :- UnpackedValScope (ToT a)
niceUnpackedValueEvi :: NiceUnpackedValue a :- UnpackedValScope (ToT a)
niceUnpackedValueEvi =
ProperUnpackedValBetterErrors (ToT a) :- UnpackedValScope (ToT a)
forall (t :: T).
ProperUnpackedValBetterErrors t :- UnpackedValScope t
properUnpackedValEvi @(ToT a) (ProperUnpackedValBetterErrors (ToT a) :- UnpackedValScope (ToT a))
-> (NiceUnpackedValue a :- ProperUnpackedValBetterErrors (ToT a))
-> NiceUnpackedValue a :- UnpackedValScope (ToT a)
forall (b :: Constraint) (c :: Constraint) (a :: Constraint).
(b :- c) -> (a :- b) -> a :- c
`trans` NiceUnpackedValue a :- ProperUnpackedValBetterErrors (ToT a)
forall (a :: Constraint) (b :: Constraint). (a, b) :- b
weaken2
nicePrintedValueEvi :: forall a. NicePrintedValue a :- PrintedValScope (ToT a)
nicePrintedValueEvi :: NicePrintedValue a :- PrintedValScope (ToT a)
nicePrintedValueEvi =
ProperPrintedValBetterErrors (ToT a) :- PrintedValScope (ToT a)
forall (t :: T).
ProperPrintedValBetterErrors t :- PrintedValScope t
properPrintedValEvi @(ToT a) (ProperPrintedValBetterErrors (ToT a) :- PrintedValScope (ToT a))
-> (NicePrintedValue a :- ProperPrintedValBetterErrors (ToT a))
-> NicePrintedValue a :- PrintedValScope (ToT a)
forall (b :: Constraint) (c :: Constraint) (a :: Constraint).
(b :- c) -> (a :- b) -> a :- c
`trans` NicePrintedValue a :- ProperPrintedValBetterErrors (ToT a)
forall (a :: Constraint) (b :: Constraint). (a, b) :- b
weaken2