[Haskell] Re: Boxing (Day) Question

Ashley Yakeley ashley at semantic.org
Wed Dec 28 15:38:13 EST 2005


Taral wrote:
> Just a strange thought, but what about...
> 
> foo :: x# -> ...
> =>
> ... foo (void *x, ...) { ... }
> 
> Just because it's unboxed doesn't mean it isn't in memory...

Then you have to worry about garbage collection. That's OK, but that 
would be a separate kind, pointers to unboxed values that the garbage 
collector can reclaim. But we might also want literals.

The idea is to do C in Haskell, but with better typing. We separate out 
the storage aspects of C types as kinds, while leaving the semantics as 
types. One could add various kinds of "polykindism", which would mostly 
end up as compile-time overloading (or inlined) similar to C++ 
templates. For instance:

   (#,#) :: #m -> #n -> #m+n

I'm not really sure how much demand there is for it, mind, given the 
possible degree of complexity involved in doing it right.

-- 
Ashley Yakeley



More information about the Haskell mailing list