From: Eric C. C. <ec...@cm...> - 2003-02-27 19:02:50
|
On Thu, Feb 27, 2003 at 05:00:49PM +0100, Michal Moskal wrote: > On Thu, Feb 27, 2003 at 02:51:58PM +0100, Stefano Zacchiroli wrote: > > (* given a 'a option returns the 'a value if it's Some _ or raise an > > exception, find a better name! *) > > - val unsome : 'a option -> 'a > > Isn't this called valOf in SML? But unsome sounds better to me. This might not be to everyone's tastes, but I often use a related function that I call "the": val the : 'a option ref -> 'a which fails with Failure "uninitialized variable" when the (dereferenced) option is None. I typically use it with 'a option refs that represent global variables, like options set on the command line: let channel = open_in (the input_file) in ... etc. -- Eric C. Cooper e c c @ c m u . e d u |