Warn against using 'fail' directly in user-code
Niklas Hambüchen
mail at nh2.me
Mon Dec 16 17:37:54 UTC 2013
> (Fwiw, I've tested attaching such a warning to `fail` in GHC HEAD's
> libraries/base/GHC/Base.lhs and it seems to work just fine so far... so
> if there's consensus, we could add that for GHC 7.8)
That sounds great!
And as far as I remember, we will have MonadFail, as Malcolm mentioned,
soon.
On 16/12/13 13:54, Andreas Abel wrote
> fail :: String -> m a
>
> Fail with a message. This operation is not part of the mathematical
> definition of a monad, but is invoked on pattern-match failure in a do
> expression.
This seems to go well with your change.
More information about the Libraries
mailing list