I can kinda help with this. The issue being bumped into here is called “polymorphic kinds” or “polykinds.” Here’s some references on the matter:
- Polymorphic Kinds.purs - PureScript: Jordan's Reference
- When to use kind annotation?
- documentation/migration-guides/0.14-Migration-Guide.md at master · purescript/documentation · GitHub
If you add a kind annotation to T':
data T' :: (Type -> Type) -> Type -> Type
data T' f a = T' (f a)
then it’ll work (of course that kinda defeats the purpose of asking the REPL to print the kind information).
I think it otherwise could have kind
data T' :: forall k. (k -> Type) -> k -> Type
I can’t do a good job of explaining why T' needs the annotation and others don’t, and I can’t do a good job of explaining what other k’s you could use to do something useful besides Type.