
Hello What is the correct way to transform code that uses record selection with TypeEq (like HList) to associated types? I keep running into problems with overlapping type families which is not allowed unless they match. The fundep code: class Select rec label val | rec label -> val instance TypeEq label label True => Select (Label label val :+: rest) label val instance (Select tail field val) => Select (any :+: tail) field val And a conversion attempt: class SelectT rec label where type S rec label instance TypeEq label label True => SelectT (Label label val :+: rest) label where type S (Label label val :+: rest) label = val instance (SelectT tail field) => SelectT (any :+: tail) field where type S (any :+: tail) field = S tail field which fails with: Conflicting family instance declarations: type instance S (Label label val :+: rest) label -- Defined at t.hs:19:9 type instance S (any :+: tail) field -- Defined at t.hs:23:9 How is it possible to get the TypeEq constraint into the type family? Attached is a complete example that illustrates the problem. - Taru Karttunen