Rational for the special case in mkWWcpr_help

Spiwack, Arnaud arnaud.spiwack at tweag.io
Wed Sep 5 14:01:34 UTC 2018


Dear all,

The function mkWWcpr_help, which creates a wrapper and a worker after
strictness analysis, has a special case when there is a single result of
unlifted type:

Wrapper:     case (..call worker..) of x -> C x
Worker:      case (   ..body..    ) of C x -> x

But I don't understand how it is different from using (# #) as would result
from the general case:

Wrapper:     case (..call worker..) of (# x #) -> C x
Worker:      case (   ..body..    ) of C x -> (# x #)

That is, my understanding of the latter is that it would yield the exact
same code. I'm obviously missing something, I'd love to know what.

Best,
Arnaud
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20180905/b084b506/attachment.html>


More information about the ghc-devs mailing list