On Thu, Nov 5, 2009 at 6:15 PM, brian <briand@aracnet.com> wrote:

On Nov 5, 2009, at 8:26 AM, Jason Dagit wrote:



Haskell knows when I have a list of Doubles, you know, because it's strongly typed.

Then it proceeds to box them. Huh ?

Imagine a computation which will yield a Double if evaluated, but has not yet been evaluated.   How do you store that in the list?


So laziness is causing the boxing to be necessary ?


"Necessary" is a strong word within formal/mathematical communities.  If you mean it in that sense, then I'm not sure it's necessary.  My (incomplete) understanding is that no one has a better way than boxing that has as wide applicability as boxing.  Perhaps there are techniques that work better.  My guess is that they are either 1) special cases; or 2) have yet to be discovered.  I wonder if perhaps supercompilation or perhaps whole program optimizations will eventually be able to eliminate much of the boxing we have today.  Strictness analysis has done a lot to remove boxing but it is not perfect due to the halting problem.

Jason