Open mgsloan opened 6 years ago
I've looked at this a bit more and it appears to be a limitation of generics. Not sure though, maybe there's a way around it.
I think you're basically right with the diagnosis.
By the power of closed type families, undecidable instances, and polykinds, I've made the following evil incantations that might work to get the type arguments of an arbitrary type:
data Wrap a -- poly-kinded wrapper
type family Vars' f xs where
Vars' (Wrap (f x)) xs = Vars' (Wrap f) (x:xs)
Vars' z xs = xs
type Vars a = Vars' (Wrap a) '[]
From that we should be able to derive flowTypeVars, which should also be being used in the pretty-printer directly, instead of the weird map-building stuff it does now.
Looks like what's happening is: