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
environment idiom
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-12-13 (02:03)
From: Michael Walter <>
Subject: Re: [Caml-list] environment idiom
On 13 Dec 2004 11:48:55 +1100, skaller <> wrote:
> So the monadic model is good, because it plainly separates
> the 'purely functional' non-monadic code, from the
> monadic code, which admits two distinct views -- at the lower
> level it is pure, whilst the higher level interpretation
> might not be -- depending both on the monad being used,
> and also how it is used.
It is probably better to say "from the outside it is pure, and inside
it appears impure, relative to its boundary" (thus stressing the point
that your apparent impurity is only a "view" <wink>).

I think the problem is that we are using "pure" twofold here:

a) As an (absolute) property of the language
b) As the property of code (which is relative to its environment)

As you can obviously emulate impurity in a pure language (see State
monad), and code pure in a impure language, it is not much of a
surprise that b) can differ from a).