
On 23 March 2006 02:24, Ben Rudiak-Gould wrote:
Bulat Ziganshin wrote:
Taral wrote:
I don't see that more optimization follows from the availability of information regarding the strictness of a function result's 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.
Yes, this is why the unboxed 1-tuple makes sense :-) indexArray# :: Array# a -> Int# -> (# a #) Cheers, Simon
participants (1)
-
Simon Marlow