Unlifted data types

Dan Doel dan.doel at gmail.com
Sun Sep 6 20:56:35 UTC 2015


On Sat, Sep 5, 2015 at 1:35 PM, Dan Doel <dan.doel at gmail.com> wrote:
> Also, the constructor isn't exactly relevant, so much as whether the
> unlifted error occurs inside the definition of a lifted thing.

So, in light of this, `Box` is not necessary to define `suspend`. We
can simply write:

    suspend :: Force a -> a
    suspend (Force x) = x

and the fact that `a` has kind * means that `suspend undefined` only
throws an exception if you inspect it.

`Box` as currently defined (not the previous GADT definition) is novel
in that it allows you to suspend unlifted types that weren't derived
from `Force`. And it would probably be useful to have coercions
between `Box (Force a)` and `a`, and `Force (Box u)` and `u`. But (I
think) it is not necessary for mediating between `Force a` and `a`.

-- Dan


More information about the ghc-devs mailing list