<div dir="ltr">Is it very difficult to convert from HsType to Type?<div><br></div><div>Thanks for the information!</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-20 18:17 GMT+02:00 Richard Eisenberg <span dir="ltr"><<a href="mailto:eir@cis.upenn.edu" target="_blank">eir@cis.upenn.edu</a>></span>:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hi Alejandro,</div><div><br></div><div>It sounds like you want tc_infer_lhs_type from TcHsType. This function is not exported, but you can look around at other functions in that module to see if there's an exported one that serves your needs. You may need to convert the HsType to a Type (Type is the same as TcType, roughly) and then call typeKind.</div>

<div><br></div><div>I hope this helps!</div><div>Richard</div><br><div><div><div class="h5"><div>On Jul 20, 2014, at 8:45 AM, Alejandro Serrano Mena <<a href="mailto:trupill@gmail.com" target="_blank">trupill@gmail.com</a>> wrote:</div>

<br></div></div><blockquote type="cite"><div><div class="h5"><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" target="_blank">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></div></div>
_______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>

</blockquote></div><br></div></blockquote></div><br></div>