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 ofBool -> Bool
-
reifyType ''Either
would produce a representation ofType -> 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.