{-# language AllowAmbiguousTypes, DataKinds, TypeFamilies #-} import Data.Kind (Constraint, Type) import Data.Tagged import GHC.TypeLits (Symbol) type HList :: [Type] -> Type data family HList xs data instance HList '[] = HNil data instance HList (x ': xs) = x `HCons` HList xs type Merge :: [Symbol] -> [Type] -> Constraint class Merge ls ts where merge :: HList ts -> HList whatgoeshere -- ???????? instance Merge ls ts => Merge (l : ls) (t : ts) where merge (HCons t ts) = HCons (Tagged @l t) (merge @ls ts) instance Merge '[] '[] where merge HNil = HNil