
Does anyone remember the justification of not having unlifted or open kinds in the source language?
They aren’t in the source language because they are a gross hack, with many messy consequences. Particularly the necessary sub-kinding, and the impact on inference. I’m not proud of it.
But I do have a plan. Namely to use polymorphism. Currently we have
kinds k ::= * | # | ? | k1 -> k2 | ...
Instead I propose
kinds k ::= TYPE bx | k1 -> k2 | ....
boxity bx ::= BOXED | UNBOXED | bv
where bv is a boxity variable
So
· * = TYPE BOXED
· # = TYPE UNBOXED
· ? = TYPE bv
Now error is polymorphic:
error :: forall bv. forall (a:TYPE bv). String -> a
And now everything will work out smoothly I think. And it should be reasonably easy to expose in the source language.
All that said, there’s never enough time to do these things.
Simon
From: Glasgow-haskell-users [mailto:glasgow-haskell-users-bounces@haskell.org] On Behalf Of Conal Elliott
Sent: 16 April 2014 18:01
To: Richard Eisenberg
Cc: glasgow-haskell-users@haskell.org
Subject: Re: Concrete syntax for open type kind?
Oops! I was reading ParserCore.y, instead of Parser.y.pp. Thanks.
Too bad it's not possible to replicate this type interpretation of `error` and `undefined`. I'm doing some Core transformation, and I have a polymorphic function (reify) that I want to apply to expressions of lifted and unlifted types, as a way of structuring the transformation. When my transformation gets to unlifted types, the application violates the *-kindedness of my polymorphic function. I can probably find a way around. Maybe I'll build the kind-incorrect applications and then make sure to transform them away in the end. Currently, the implementation invokes `error`.
Does anyone remember the justification of not having unlifted or open kinds in the source language?
-- Conal
On Tue, Apr 15, 2014 at 5:09 PM, Richard Eisenberg