You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fail s cannot contain any values of an arbitrary type a.
Therefore, f can never be invoked by >>=.
Since f cannot be invoked, >>= must behave the same way for any f.
Take f be pure — by a law of monad >>= pure ≡ id. Therefore, by №3 >>= f ≡ id for any f.
id (fail s) ≡ fail s. ∎
— Maybe like this.
But this all on the assumption that everything is defined. Is this an admissible assumption? Otherwise, we can consider situations where >>= invokes f with undefined — then f can either crash (≢ fail s) or return an arbitrary value (≢ fail s).
The
MonadFail
docs say thatfail s
must be a "left zero", i.e.But given that
fail s :: forall a. m a
is there any way that it couldn't be a left zero?The text was updated successfully, but these errors were encountered: