Skip to content

Draft: Take COMPLETE pragmas into account when computing whether a pattern is fallible in the typechecker

sheaf requested to merge sheaf/ghc:T22004 into master

This WIP MR addresses #15681

It ensures we take COMPLETE pragmas into account when we are computing whether a pattern is fallible in the typechecker (not in the pattern match checker).
It's still a conservative check, but catches the common cases in which we were unnecessarily requiring MonadFail constraints, e.g.

{-# COMPLETE C #-}
pattern C a = ...

blah = do { C x <- ... }

now no longer requires a MonadFail constraint.

Edited by Simon Peyton Jones

Merge request reports