* Add cases for tagToEnum and dataToTag. This is the main new
bit. It allows the simplifier to remove the pervasive uses
of case tagToEnum (a > b) of
False -> e1
True -> e2
and replace it by the simpler
case a > b of
DEFAULT -> e1
1# -> e2
See Note [caseRules for tagToEnum]
and Note [caseRules for dataToTag] in PrelRules.

* This required some changes to the API of caseRules, and hence
to code in SimplUtils. See Note [Scrutinee Constant Folding]
in SimplUtils.

* Move Note [Word/Int underflow/overflow] to Literal, as
documentation to accompany mkMachIntWrap etc; and get
rid of PrelRuls.intResult' in favour of mkMachIntWrap
```

I do not yet understand exactly where this goes wrong. But I hope
someone else will be able to help out? I do find it curious though
that this bug seems to have gone unnoticed (assuming the commit
git bisect found is indeed the underlying issue) for almost half
a year. And please, if my analysis is faulty at some point don’t
hesitate to point that out!

Cheers,
Moritz

PS: can we have a folder in ghc, which contains cabal packages,
and part of the validation is just iterating over all those
packages with `cabal new-test -w /path/to/inplace/bin/ghc-stage2`?
In that case, one could simply change the executable target in
[1] into a testsuite, and drop the package into that folder?

Re: [broken HEAD] In which the strict state monad fails at basic arithmetic

> Hi *,
>
> while working on some related code. I came across a rather peculiar behavior
> with GHC built from the current master branch at b2c2e3e8.
>
Indeed this sounds like a real bug. Can you open a ticket?

Also, it looks like the gist has projected out directory structure; do
you think you could push the testcase as a proper git repository?

>
> PS: can we have a folder in ghc, which contains cabal packages,
> and part of the validation is just iterating over all those
> packages with `cabal new-test -w /path/to/inplace/bin/ghc-stage2`?
> In that case, one could simply change the executable target in
> [1] into a testsuite, and drop the package into that folder?
>
The problem is that we don't have access to cabal-install. However,
I think there is certainly room for this sort of testing as part of, for
instance, the nightly test cycle. In this case we'd likely want to
contain this infrastructure in a repository outside of ghc proper.

Re: [broken HEAD] In which the strict state monad fails at basic arithmetic

> Hi *,
>
> while working on some related code. I came across a rather peculiar behavior
> with GHC built from the current master branch at b2c2e3e8.
>
The issue was a bug indeed introduced by the commit you cite below. The
problem was a mistake in a change in constant folding which,
frighteningly, the testsuite did not catch. See D3904 for a fix and a
test is forthcoming.