GHC.HsToCore.Pmc.Check

ghc-9.10.0.20240328: The GHC API

Safe Haskell | None
Language | GHC2021

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
- checkRecSel :: PmRecSel () -> CheckAction (PmRecSel Id)

# 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 # (<$) :: a -> CheckAction b -> CheckAction a #

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 #

checkRecSel :: PmRecSel () -> CheckAction (PmRecSel Id) Source #