Unexpected list non-fusion

wren ng thornton wren at freegeek.org
Sun Jan 15 04:48:56 CET 2012

On 12/12/11 3:37 PM, wren ng thornton wrote:
> I've noticed that take and filter are good producers (and consumers) for
> list fusion, but takeWhile, drop, and dropWhile are not. Is there any
> reason for this discrepancy?
> If not, would I need to go through the libraries@ process for fixing it,
> or should I just submit a patch?

In working on a patch to fix this I've come upon a question. The fusion 
rules for take seem a bit odd in that they translate the take into a 
foldr which produces (Int# -> b), instead of passing the Int# in 
directly and using foldr to produce the b.

Does anyone know why?

Live well,

More information about the Glasgow-haskell-users mailing list