Closed chrisdone closed 6 years ago
Rephrasing to avoid an X/Y problem, here's what I'm trying to achieve:
E is an expression in some language, the r
might contain location information or something like that.
data E r = E r
generate :: E r -> E { typ :: Typ | r }
I want that the E
type already contains some record, that we don't know. Then generate
is going to insert an additional type annotation of everything in E
as the field typ :: Typ
. Is this achievable with PureScript's type system?
Sorry, asked in the wrong repo. Moving to purescript
.
The following works:
But this doesn't:
What am I doing wrong? It seems like the kind of the parameter of
E
is ignored and that theforall r
is defaulting toType
instead of# Type
. However,kind signatures in a forall don't seem to be supported. What do I do?