oneShot (was Re: FoldrW/buildW issues)
mail at joachim-breitner.de
Tue Oct 7 12:20:20 UTC 2014
Am Dienstag, den 07.10.2014, 03:05 -0400 schrieb David Feuer:
> Just for the heck of it, I tried out an implementation of scanl using
> Joachim Breitner's magical oneShot primitive. Using the test
> with -O2 (NOT disabling Call Arity) the Core from barB is really,
> really beautiful: it's small, there are no lets or local lambdas, and
> everything is completely unboxed. This is much better than the result
> of barA, which has a local let, and which doesn't seem to manage to
> unbox anything.
I cannot reproduce this here. In fact, I get identical core in both
cases. Only when I do pass -fno-call-arity, A gets bad code, while B is
Maybe your example is too small?
Joachim “nomeata” Breitner
mail at joachim-breitner.de • http://www.joachim-breitner.de/
Jabber: nomeata at joachim-breitner.de • GPG-Key: 0xF0FBF51F
Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: This is a digitally signed message part
More information about the ghc-devs