Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Preventing values from escaping a context
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-02-09 (03:59)
From: Yaron Minsky <yminsky@g...>
Subject: Re: [Caml-list] Preventing values from escaping a context
On Mon, Feb 8, 2010 at 10:07 PM, Rich Neswold <>wrote:

> (I realize that making this context a monad is a legitimate solution.
> However, until I see the Ocaml community including monads in the standard
> library, I think I'll stick with idiomatic Ocaml. I'd also like to solve
> this functionally, so I'm discounting the use of objects. Sorry for these
> constraints!)

I don't know that monads solve your problem here, but monads are a perfectly
reasonable idiom in OCaml.  You won't find them in the standard library
because the standard library is very conservative.  But you will find them
in Jane Street's Core library, and we use them reasonably often.  I think
there's no reason to avoid monads in OCaml (although obviously there's not
much to be gained by using them for vanilla effects, as is done in Haskell.)