Skip to content

TemplateHaskell feature request: reifyType/reifyKind

As discussed in !1438 (merged), it would be nice to have a generalized combinator to reify the type or kind of a thing by name:

reifyType :: Name -> Q Type
  • reifyType 'not would produce a representation of Bool -> Bool
  • reifyType ''Either would produce a representation of Type -> Type -> Type

reifyType should work regardless of existence of a user-written signature:

-- no sig for 'f'
f = not

reifyType 'f   -- reifies the inferred type Bool->Bool

This combinator is a more general replacement for reifyKiSig that !1438 (merged) currently implements.

Edited by Vladislav Zavialov
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information