by noste · 17y ago · 0 comments
What would be the OCaml solution for the problem that unwind-protect solves? In Haskell, I would use bracket, and appropriately the API documentation of bracket gives the definition of withFile as an example:
withFile name mode = bracket (openFile name mode) hClose
(see http://haskell.org/ghc/docs/latest/html/libraries/base/Contr...)http://caml.inria.fr/pub/ml-archives/caml-list/2003/07/5ff66...
I think this article makes it very clear how having a huge existing set of libraries can really put a language into warp drive, whereas not having one means you are going to spend some time re-inventing the wheel. (But even in straight Ocaml, I fail to see the problem)