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
'Nondeterministic' evaluation wrt exceptions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-07-25 (15:46)
From: Gabriel Kerneis <kerneis@p...>
Subject: Re: [Caml-list] 'Nondeterministic' evaluation wrt exceptions
On Fri, Jul 25, 2008 at 04:29:47PM +0100, Dawid Toton wrote:
> I have no idea what code the syntax extension should produce. My first  
> guess is to wrap everything in
> type 'a wrapped = Exception | Value 'a
> and make all aplications evaluated. But this seems to be a big headache.  
> Maybe this is well-known, already solved problem? Any ideas?

The wrapping you describe looks a lot like a monad, and your problem
definitely looks like having many (cooperative) threads, some of them needing
to be detached (because they are blocking).

You could have a look at and adapt it to suit your
needs. Pay attention in particular to the detach() function.

Please, note I might be seeing monads and continuation-passing style
everywhere, since this is my current research topic.

Gabriel Kerneis