Re: [Caml-list] exn vs option

2012-04-05 Thread Pierre Chopin
Thank you for your answers. I am actually in the case of a webserver where I need to avoid interrupting it, even in 'exceptional' cases, but rather report the problem in a log, and return a default value whenever it is possible. Options seem to be the best choice, not only from a safety point of vi

[Caml-list] CFP - The 6th International Symposium on Intelligent Distributed Computing

2012-04-05 Thread Doina Bein
The 6th International Symposium on Intelligent Distributed Computing IDC 2012 http://idc2012.deis.unical.it September 24-26, 2012 Calabria, Italy

Re: [Caml-list] Size of Bigarray elements, or matching with 'kind'?

2012-04-05 Thread Florent Monnier
Le jeudi 05 avril 2012 07:57:45, Anthony Tavener a écrit : > I'm trying to determine the size of a Bigarray, in bytes. > > I've tried several things... ending up with this as the only solution: > > -- > let ba_char = Hashtbl.hash Bigarray.char;; > let ba_int8_signed = Hash

Re: [Caml-list] Size of Bigarray elements, or matching with 'kind'?

2012-04-05 Thread Anthony Tavener
Ah, yeah. That was an alternative I was considering, though I wasn't sure how to get the size of nativeint -- now I see: sizeof(value)! :) Still not the ideal, but probably a little nicer than using 'hash' to reveal abstracted values. ;) BTW, thank-you Florent, for your articles on interfacing wi

[Caml-list] [CFP] Call for Papers WCB12

2012-04-05 Thread Sebastian Will
[Please apologize multiple copies and crossposting.] Dear colleagues, we would like to invite you to submit a paper to WCB12 - Workshop on Constraint Based Methods for Bioinformatics 2012 September, 8th, 2012 Budapest, Hungary

Re: [Caml-list] exn vs option

2012-04-05 Thread Daniel Bünzli
Le jeudi, 5 avril 2012 à 11:05, Goswin von Brederlow a écrit : > If you are writing a module then consider providing both flavours for > functions, one with exceptions and one with options. Even if you only do > something like this: I don't think it's a rule that should be applied consistently, I

Re: [Caml-list] exn vs option

2012-04-05 Thread Goswin von Brederlow
Pierre Chopin writes: > Hi, > > I benchmarked two programs, in one case the main function throw an exception > that is caught, in the other the function returns an option that is pattern > matched on. > > I noticed that, whether the exception is thrown or not, the option version is > always faste

Re: [Caml-list] exn vs option

2012-04-05 Thread Benedikt Grundmann
That post is against maybe (aka option) as an error type as it looses information about the error. If you use an Either type such as Core's Result.t that argument is invalidated. In fact at Jane Street we try avoid the use of exceptions as they don't force the client of the library to handle the