Benjamin.Rudiak-Gould at cl.cam.ac.uk
Wed Mar 22 21:24:20 EST 2006
Bulat Ziganshin wrote:
> Taral wrote:
> T> I don't see that more optimization follows from the availability
> T> of information regarding the strictness of a function result's
> T> subcomponents.
> ghc uses unboxed tuples just for such sort of optimizations. instead
> of returning possibly-unevaluated pair with possibly-unevaluated
> elements it just return, say, two doubles in registers - a huge win
Mmm, not quite. Unboxed tuples are boxed tuples restricted such that they
never have to be stored on the heap, but this has no effect on semantics at
all. A function returning (# Double,Double #) may still return two thunks.
More information about the Haskell-prime