[Haskell-cafe] Two GHC-related GSoC Proposals
patrick at parcs.ath.cx
Sun Jun 2 15:15:59 CEST 2013
Right, these optimizations are done on the unboxed level, where bottom is
not a concern. GHC would transform
bar a b = a + b - a - b
bar (I# a) (I# b) = I# (a +# b -# a -# b)
whose RHS could be optimized away to I# 0#. bar is still strict in its two
arguments, so calling bar undefined undefined would still throw an error.
On Sun, Jun 2, 2013 at 7:24 AM, Boris Lykah <lykahb at gmail.com> wrote:
> It is not obvious that semantics is preserved for optimisations which
> remove non-constants like
> bar a b = a + b - a - b -- the RHS is should be optimized away to 0
> Calling bar undefined undefined throws an error, but the optimised bar
> would return 0.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe