@@ -21,9 +21,11 @@ module Data.Generics.Internal.Families.Has
2121 , HasCtorP
2222 ) where
2323
24−import Data.Type.Bool (type (||), type (&&))
2524import GHC.Generics
26−import GHC.TypeLits
25+
26+import Data.Type.Bool (type (||), type (&&))
27+import Data.Type.Equality (type (==))
28+import GHC.TypeLits (Symbol, TypeError, ErrorMessage (..))
2729
2830import Data.Generics.Internal.HList
2931
@@ -81,14 +83,10 @@ type family HasPartialTypeTupleP a f :: Bool where
8183 HasPartialTypeTupleP t (l :+: r)
8284 = HasPartialTypeTupleP t l || HasPartialTypeTupleP t r
8385 HasPartialTypeTupleP t (C1 m f)
84− = Equals t (ListToTuple (GCollect f))
86+ = t == ListToTuple (GCollect f)
8587 HasPartialTypeTupleP t _
8688 = 'False
8789
88−type family Equals a b where
89− Equals a a = 'True
90− Equals _ _ = 'False
91−
9290type family HasCtorP (ctor :: Symbol) f :: Bool where
9391 HasCtorP ctor (C1 ('MetaCons ctor _ _) _)
9492 = 'True