[Haskell] Re: Boxing (Day) Question

Ashley Yakeley ashley at semantic.org
Mon Dec 26 06:41:38 EST 2005

In article <43AFCA38.5000302 at augustsson.net>,
 Lennart Augustsson <lennart at augustsson.net> wrote:

> On the whole it looks like you want type variables with kind #.
> There are very good implementation reasons for not allowing this.
> If you had type variables of kind # you could have polymorphic
> functions over unboxed values.  But since the values are unboxed
> they don't have a uniform representation (e.g., a Double# is probably
> twice the size of a Float#).  So polymorphic functions over unboxed
> values are not easy to implement.  (You can imagine implementations
> of them, but none of them are pleasent.)

Oh, I hadn't thought of that.

One solution might be to have a kind for each kind of storage:

  * for boxed values
  #4 for 4-byte values
  #8 for 8-byte values
  #P for pointers to things that need to be GC'd (or whatever)

Do you think this would work?

Ashley Yakeley, Seattle WA

More information about the Haskell mailing list