Hacker News new | ask | show | jobs
by mrkgnao 3039 days ago
This is a nifty thing made possible by the MonadFail class, which defines how a monad treats or recovers from a failed pattern-match.

    When a value is bound in do-notation, the pattern on the
    left hand side of <- might not match. In this case, this 
    class provides a function to recover.
https://hackage.haskell.org/package/base-4.10.1.0/docs/Contr...