The problem is that this also accepts things that aren't pointers at all!
We could fix that *for primops* by changing RuntimeRep to something like

data RuntimeRep
  = PtrRep Liftedness
   | ...

But that would only work for primops (at least for now) so it may not be
worth the breakage.

On Wed, Aug 22, 2018, 7:45 AM Ben Gamari <b...@smart-cactus.org> wrote:

> Simon Peyton Jones <simo...@microsoft.com> writes:
>
> > |  Huh! It looks like what we currently do for some primops is just use a
> > |  totally bogus kind. For example, mkWeak# will happily accept an Int#
> as
> > |  its first argument.
> >
> > Well, I see
> >   primop  MkWeakOp "mkWeak#" GenPrimOp
> >      o -> b -> (State# RealWorld -> (# State# RealWorld, c #))
> >
> > and I believe (from Ben's message) that the "o" means "open type
> variable",
> > which is the old terminology for what we now call levity-polymorphic.
> >
> Right; currently (largely for historical reasons) we use `o` to
> accommodate cases that accept both lifted and unlifted pointers.
>
> Cheers,
>
> - Ben
>
>
_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Reply via email to