Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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 http://ocsigen.org/lwt 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.

Regards,
-- 
Gabriel Kerneis