Just to see if we're talking about the same, here are the two versions of 
the program I'm comparing

    https://gist.github.com/michaelt/c8789970e8f096e56fff

chunkX.hs is the 'idiomatic' version, but I bring the definition of splitAt 
into the module to make it
easier to compare to the other. chunkX just differs by pattern matching on 
the Proxy constructors.

chunkX.hs takes half-again as long as chunkZ.hs, 


    real 0m5.332s  -- with next

    user 0m5.247s

    sys 0m0.064s


    real 0m3.631s  -- without next

    user 0m3.541s

    sys 0m0.060s

Here are the two chunks of core, excluding what was the same

   https://gist.github.com/michaelt/8f82c82a96cf77f162da

`next` is brought into the core for chunkX.hs , since it is 'inlinable', 
and is specialized to IO, if I understand.
But it is a separate 'loop'.  The loop for splitAt then refers to it, and 
performs monadic extraction. It is 
pretty  much the same as the written program.

The core for the chunkZ.hs invades the written program much more. 
I'm not sure how well I can articulate or appraise the differences.

-- 
You received this message because you are subscribed to the Google Groups 
"Haskell Pipes" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to haskell-pipes+unsubscr...@googlegroups.com.
To post to this group, send email to haskell-pipes@googlegroups.com.

Reply via email to