<div dir="ltr">Dear Haskell-café,<div>I'm trying to get some information of the kinds of types in a program. In particular, I want to obtain the kinds of arguments to type family instances, that is, given:</div><div><br>

</div><div>type family F a b :: Nat</div><div>type instance F (List k) b = b</div><div><br></div><div>I would like to obtain the kinds of "k" and "b" in the left-hand side of the type instance.</div><div>

<br></div><div>In particular, I'm obtaining type family instance information via <font face="courier new, monospace">LTyFamInstEqn</font> [<a href="http://www.haskell.org/ghc/docs/latest/html/libraries/ghc/HsDecls.html#t:LTyFamInstEqn">http://www.haskell.org/ghc/docs/latest/html/libraries/ghc/HsDecls.html#t:LTyFamInstEqn</a>]. Inside, I get a list of binders of type <font face="courier new, monospace">HsWithBndrs [LHsType name]</font>. I'm assuming each of the <font face="courier new, monospace">LHsType</font>s inside is a pattern in the type family instance. Thus, I'm looking at those elements and try to find their kind there.</div>

<div><br></div><div>Thus, the specific question is: given a <font face="courier new, monospace">HsType</font>, can I obtain its kind somehow?</div><div><br></div><div>Thanks in advance</div></div>