This is an example of https://ghc.haskell.org/trac/
ghc/ticket/12088 .
The “type instance T List” declaration actually depends on the “type instance K List” declaration; the latter must be typechecked before the former. But this dependency is absolutely unclear. There’s a long discussion on the thread. Bottom line: we don’t know a solid automated way to spot this kind of problem, so I think we are going to ask for programmer assistance. In this case, we’d put a “separator” after the “type instance K List” decl, to explain that it must be done first:
type instance K List = Type
===========
type instance T List = []
Currently you have to write $(return []) to get the separator, but I think we’ll add a special separator.