Browse thread
Static exception analysis or alternative to using exceptions
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Florent Ouchet <florent.ouchet@i...> |
| Subject: | Re: [Caml-list] Static exception analysis or alternative to using exceptions |
Goswin von Brederlow a écrit : > Imho a good module should provide both an exception and option based > interface to fit the circumstances and programming style. > > +1 > It would be nice if the possible exceptions of a function would be part > of the type. E.g. > > let f1 () = raise Not_found > val f1 : unit -> 'a [ Not_found ] > > let f2 () = try f1 () with Not_found -> () > val f2 : unit -> unit > > let f3 f = try f () with Not_found -> () > val f3: (unit -> 'a [< Not_found | 'B ]) -> 'a [ 'B ] > > and so on. > > > Someone would have to write a new type system for that though. > > ocamlexc gave such results, but this tool is now discontinued and not compatible with latest compilers :( -- Florent Ouchet PhD Student CIS/VDS Team - TIMA Laboratory