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
It won't compile, because of type mismatch. So I think compiler should see error function as a special case, or provide mechanisms to support throwing exception.
In Haskell, the message that sent from error function could be caught by Control.Exception.catch.
The definition of error in Haskell is
error:: [Char] ->a
The text was updated successfully, but these errors were encountered:
We probably need support of
error
just like the one in Haskell. It won't be able to write one by user, because that will cause a type mismatch error.Example use case:
If I define
error
like thisIt won't compile, because of type mismatch. So I think compiler should see
error
function as a special case, or provide mechanisms to support throwing exception.In Haskell, the message that sent from
error
function could be caught byControl.Exception.catch
.The definition of
error
in Haskell isThe text was updated successfully, but these errors were encountered: