{-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeFamilyDependencies #-} {-# LANGUAGE UndecidableInstances #-} module M where import Data.Kind (Type) type MapList :: (Type -> Type) -> [Type] -> [Type] type family MapList f xs = r | r -> xs where MapList f '[] = '[] MapList f (x ': xs) = f x ': MapList f xs