MonadFail proposal (MFP): Moving fail out of Monad

David Luposchainsky dluposchainsky at googlemail.com
Mon Jun 15 18:18:33 UTC 2015


On 11.06.2015 18:20, Dan Doel wrote:
> I believe a pattern is classified as unfailable there if it is irrefutable or 
> refutable only by bottom. Which of course is the distinction here, (x,y) is 
> unfailable, but not irrefutable.

Some of the confusion may be because GHC has a function "isIrrefutableHsPat" that
seems to check whether a pattern is irrefutable by your definition. The source
comment talks about naming a bit:

> (isIrrefutableHsPat p) is true if matching against p cannot fail,
> in the sense of falling through to the next pattern.
>      (NB: this is not quite the same as the (silly) defn
>      in 3.17.2 of the Haskell 98 report.)

Source:
https://github.com/ghc/ghc/blob/c5911479f295242e16e396eb5d1369f2e4ce8de0/compiler/hsSyn/HsPat.hs#L443

(Time for a PatternUnfallthroughableProposal?)

Greetings,
David


More information about the ghc-devs mailing list