oneShot (was Re: FoldrW/buildW issues)

Joachim Breitner mail at
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
still good.

Maybe your example is too small?


Joachim “nomeata” Breitner
  mail at joachim-breitner.de
  Jabber: nomeata at  • GPG-Key: 0xF0FBF51F
  Debian Developer: nomeata at

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the ghc-devs mailing list