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
@oberblastmeister Thanks for the suggestion. I think what you suggested is closer to exceptions, not effects (in the OCaml terminology), because throw never returns. Algebraic effects will/should return eventually, for otherwise we might incorrectly skip exception handlers on the stack. For example, the following code could be wrong if throw never returns:
let f = openFile "..." in
Fun.protect ~finally:closeFile $ throw "error"
The only way to guarantee the resumption of the continuation after calling throw is to unconditionally raise some exception, but then we can just use exceptions directly. That's why the library dose not provide the error effect. Please let me know if I missed something. 🙂
It should have this signature
The text was updated successfully, but these errors were encountered: