Skip to content

Instantly share code, notes, and snippets.

View jonathanknowles's full-sized avatar

Jonathan Knowles jonathanknowles

View GitHub Profile
@jonathanknowles
jonathanknowles / ocaml_backtrace_decapitation.ml
Created November 26, 2010 11:10
OCaml Backtrace Decapitation
(* A demonstration of OCaml Exception Backtrace Decapitation *)
(* Author: Jonathan Knowles <jonathan.knowles@eu.citrix.com> *)
exception Foo
exception Bar
type ('a, 'b) result = Success of 'a | Failure of 'b
let try_finally f g =
let fr = try Success (f ()) with e -> Failure (e) in