summaryrefslogtreecommitdiff
path: root/compiler/GHC/HsToCore/GuardedRHSs.hs
Commit message (Collapse)AuthorAgeFilesLines
* Modules: Utils and Data (#13009)Sylvain Henry2020-04-261-3/+3
| | | | | | | Update Haddock submodule Metric Increase: haddock.compiler
* `MatchResult'` -> `MatchResult`John Ericson2020-04-221-5/+5
| | | | Inline `MatchResult` alias accordingly.
* Inline `adjustMatchResult`John Ericson2020-04-221-1/+1
| | | | It is just `fmap`
* Use trees that grow for rebindable operators for `<-` bindsJohn Ericson2020-04-171-1/+1
| | | | Also add more documentation.
* Make NoExtCon fields strictwip/strict-NoExtConRyan Scott2020-04-071-4/+0
| | | | | | | | | | | | | | | | This changes every unused TTG extension constructor to be strict in its field so that the pattern-match coverage checker is smart enough any such constructors are unreachable in pattern matches. This lets us remove nearly every use of `noExtCon` in the GHC API. The only ones we cannot remove are ones underneath uses of `ghcPass`, but that is only because GHC 8.8's and 8.10's coverage checkers weren't smart enough to perform this kind of reasoning. GHC HEAD's coverage checker, on the other hand, _is_ smart enough, so we guard these uses of `noExtCon` with CPP for now. Bumps the `haddock` submodule. Fixes #17992.
* Modules: Types (#13009)Sylvain Henry2020-03-291-1/+1
| | | | | | | Update Haddock submodule Metric Increase: haddock.compiler
* Modules: Core (#13009)Sylvain Henry2020-03-161-1/+1
| | | | Update submodule: haddock
* PmCheck: Implement Long-distance information with Covered setsSebastian Graf2020-02-271-26/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider ```hs data T = A | B | C f :: T -> Int f A = 1 f x = case x of A -> 2 B -> 3 C -> 4 ``` Clearly, the RHS returning 2 is redundant. But we don't currently see that, because our approximation to the covered set of the inner case expression just picks up the positive information from surrounding pattern matches. It lacks the context sensivity that `x` can't be `A` anymore! Therefore, we adopt the conceptually and practically superior approach of reusing the covered set of a particular GRHS from an outer pattern match. In this case, we begin checking the `case` expression with the covered set of `f`s second clause, which encodes the information that `x` can't be `A` anymore. After this MR, we will successfully warn about the RHS returning 2 being redundant. Perhaps surprisingly, this was a great simplification to the code of both the coverage checker and the desugarer. Found a redundant case alternative in `unix` submodule, so we have to bump it with a fix. Metric Decrease: T12227
* Modules: Core (#13009)Sylvain Henry2020-02-261-3/+3
| | | | Update haddock submodule
* Modules: Driver (#13009)Sylvain Henry2020-02-211-1/+1
| | | | submodule updates: nofib, haddock
* Module hierarchy: HsToCore (cf #13009)Sylvain Henry2020-02-141-0/+155