ghc-9.6.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.HsToCore.Pmc.Check

Description

Coverage checking step of the Lower Your Guards paper.

Coverage check guard trees (like ``PmMatch` `Pre``) to get a `CheckResult`, containing

1. The set of uncovered values, `cr_uncov`
2. And an annotated tree variant (like ``PmMatch` `Post``) that captures redundancy and inaccessibility information as `RedSets` annotations

Basically the UA function from Section 5.1, which is an optimised interleaving of U and A from Section 3.2 (Figure 5). The Normalised Refinement Types `Nablas` are maintained in GHC.HsToCore.Pmc.Solver.

Synopsis

- newtype CheckAction a = CA {
  - unCA :: Nablas -> DsM (CheckResult a)
  }
- checkMatchGroup :: PmMatchGroup Pre -> CheckAction (PmMatchGroup Post)
- checkGRHSs :: PmGRHSs Pre -> CheckAction (PmGRHSs Post)
- checkPatBind :: PmPatBind Pre -> CheckAction (PmPatBind Post)
- checkEmptyCase :: PmEmptyCase -> CheckAction PmEmptyCase

# Documentation

newtype CheckAction a Source #

Coverage checking action. Can be composed `leftToRight` or `topToBottom`.

Constructors

CA |

Fields

- unCA :: Nablas -> DsM (CheckResult a)

#### Instances

Instances details

Functor CheckAction Source # |
Instance details Defined in GHC.HsToCore.Pmc.Check Methods fmap :: (a -> b) -> CheckAction a -> CheckAction b Source # (<$) :: a -> CheckAction b -> CheckAction a Source #

checkMatchGroup :: PmMatchGroup Pre -> CheckAction (PmMatchGroup Post) Source #

checkGRHSs :: PmGRHSs Pre -> CheckAction (PmGRHSs Post) Source #

checkPatBind :: PmPatBind Pre -> CheckAction (PmPatBind Post) Source #

checkEmptyCase :: PmEmptyCase -> CheckAction PmEmptyCase Source #