From 889e799ad8980d8b3521e1bf2bef2cf99fa387e4 Mon Sep 17 00:00:00 2001 From: effectfully Date: Wed, 5 Jan 2022 16:14:06 +0300 Subject: [PATCH] Use type synonyms --- .../src/PlutusCore/Constant/Typed.hs | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/plutus-core/plutus-core/src/PlutusCore/Constant/Typed.hs b/plutus-core/plutus-core/src/PlutusCore/Constant/Typed.hs index 9b3179d1987..ae0ace663c9 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Constant/Typed.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Constant/Typed.hs @@ -514,17 +514,17 @@ type family ListToBinds (x :: [a]) :: [GADT.Some TyNameRep] type instance ListToBinds '[] = '[] type instance ListToBinds (x ': xs) = Merge (ToBinds x) (ListToBinds xs) --- -- We need to be able to partially apply that in the definition of 'ImplementedKnownBuiltinTypeIn', --- -- hence defining it as a class synonym. --- -- | A constraint for \"@a@ is a 'KnownType' by means of being included in @uni@\". --- class (HasConstantIn uni term, GShow uni, GEq uni, uni `Contains` a) => --- KnownBuiltinTypeIn uni term a --- instance (HasConstantIn uni term, GShow uni, GEq uni, uni `Contains` a) => --- KnownBuiltinTypeIn uni term a +-- We need to be able to partially apply that in the definition of 'ImplementedKnownBuiltinTypeIn', +-- hence defining it as a class synonym. +-- | A constraint for \"@a@ is a 'KnownType' by means of being included in @uni@\". +class (HasConstantIn uni term, GShow uni, GEq uni, uni `Contains` a) => + KnownBuiltinTypeIn uni term a +instance (HasConstantIn uni term, GShow uni, GEq uni, uni `Contains` a) => + KnownBuiltinTypeIn uni term a -- | A constraint for \"@a@ is a 'KnownType' by means of being included in @uni@\". -type KnownBuiltinTypeIn uni term a = (HasConstantIn uni term, GShow uni, GEq uni, uni `Contains` a) +-- type KnownBuiltinTypeIn uni term a = (HasConstantIn uni term, GShow uni, GEq uni, uni `Contains` a) -- | A constraint for \"@a@ is a 'KnownType' by means of being included in @UniOf term@\". type KnownBuiltinType term a = KnownBuiltinTypeIn (UniOf term) term a @@ -628,12 +628,12 @@ class uni ~ UniOf term => KnownTypeIn uni term a where readKnown = inline readKnownConstant {-# INLINE readKnown #-} --- -- | Haskell types known to exist on the PLC side. See 'KnownTypeIn'. --- class (KnownTypeAst (UniOf term) a, KnownTypeIn (UniOf term) term a) => KnownType term a --- instance (KnownTypeAst (UniOf term) a, KnownTypeIn (UniOf term) term a) => KnownType term a - -- | Haskell types known to exist on the PLC side. See 'KnownTypeIn'. -type KnownType term a = (KnownTypeAst (UniOf term) a, KnownTypeIn (UniOf term) term a) +class (KnownTypeAst (UniOf term) a, KnownTypeIn (UniOf term) term a) => KnownType term a +instance (KnownTypeAst (UniOf term) a, KnownTypeIn (UniOf term) term a) => KnownType term a + +-- -- | Haskell types known to exist on the PLC side. See 'KnownTypeIn'. +-- type KnownType term a = (KnownTypeAst (UniOf term) a, KnownTypeIn (UniOf term) term a) -- | Same as 'readKnown', but the cause of a potential failure is the provided term itself. readKnownSelf