[Haskell-cafe] Obtaining kind of a HsType

Alejandro Serrano Mena trupill at gmail.com
Sun Jul 20 12:45:02 UTC 2014


Dear Haskell-café,
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:

type family F a b :: Nat
type instance F (List k) b = b

I would like to obtain the kinds of "k" and "b" in the left-hand side of
the type instance.

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

Thus, the specific question is: given a HsType, can I obtain its kind
somehow?

Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140720/3d0b3dc1/attachment.html>


More information about the Haskell-Cafe mailing list