Skip to content

Commit

Permalink
Use type synonyms
Browse files Browse the repository at this point in the history
  • Loading branch information
effectfully committed Jan 5, 2022
1 parent c1beb8a commit 889e799
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions plutus-core/plutus-core/src/PlutusCore/Constant/Typed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 889e799

Please sign in to comment.