I would like to ask GHCi for the type that a type expression will evaluate to, once all definitions of type synonyms and (when possible) type families have been inlined.<div><br></div><div>It appears that I can do some part of this for type T by using &quot;:t undefined :: T&quot;:</div>

<div><br></div><div><div>type family F a</div><div>type instance F Int = Bool</div><div>type instance F Bool = Int</div><div>type instance F (a, b) = (F a, F b)</div></div><div><br></div><div><div>ghci&gt; :t undefined :: F (Int, Bool)</div>

<div>undefined :: F (Int, Bool) :: (Bool, Int)</div></div><div><br></div><div>I also get what I expect here:</div><div><br></div><div><div>ghci&gt; :t undefined :: F (a, Bool)</div><div>undefined :: F (a, Bool) :: (F a, Int)</div>

</div><div><br></div><div>Of course, this doesn&#39;t work on types of kinds other than *.</div><div><br></div><div>Is it possible and worth having another GHCi command to perform this operation for any types? It could be the type analogue to :t such that it evaluates the type and gives its kind.</div>

<div><br></div><div>Regards,</div><div>Sean</div>