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
[Caml-list] Future of labels
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Markus Mottl <mottl@m...>
Subject: Re: [Caml-list] Implicit parameters (was Future of labels)
On Fri, 30 Mar 2001, Jacques Garrigue wrote:
> You can easily do dynamic scoping in ML (contrary to Haskell), by
> using references. The only pitfall is that the produced code is not
> reentrant.

Another solution to this problem is to use a state monad that passes
around the parameter implicitly. This would also keep the code purely
functional (= reentrant).

The only problem here is that using monads in their general form with
OCaml is usually more cumbersome than with Haskell due to the lack
of overloading. It's also a quite bit slower than passing around the
parameter explicitly.

For those who want to see an example of the use of state monads and to
compare with a solution that passes around the state parameter explicitly,
you can take a look at the following:

Markus Mottl

Markus Mottl,,
To unsubscribe, mail  Archives: