Motivation for refineDefaultAlt

Simon Peyton Jones simonpj at microsoft.com
Fri May 11 15:03:05 UTC 2018


Because if e contains
            …(case x of Foo p q -> e2)…
as a sub-expression, we’d like to simplify it.

Sorry that is not documented; please do add that to the comments in the source code.

Simon

From: ghc-devs <ghc-devs-bounces at haskell.org> On Behalf Of Matthew Pickering
Sent: 11 May 2018 15:54
To: GHC developers <ghc-devs at haskell.org>
Subject: Motivation for refineDefaultAlt

Hi all,

Does anyone know the motivation for refineDefaultAlt?
The comment states

- -- | Refine the default alternative to a 'DataAlt', if there is a unique way to do so.
OK - so the code transforms something like
case x of { DEFAULT -> e }
===>
case x of { Foo a1 a2 a3 -> e }


but why is this necessary or desirable?
Perhaps you know Simon (Jakobi)?
Cheers,

Matt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20180511/4937ac3b/attachment.html>


More information about the ghc-devs mailing list