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: -- (:)
From: Michael Walter <>
Subject: Re: [Caml-list] environment idiom
On 12 Dec 2004 16:33:29 +1100, skaller <> wrote:
> Yes, that indeed is my intention. Basically, any non-transparent
> non-function code can be made purely functional and transparent
> with a simple transformation, yet it doesn't by this transformation
> get any easier to reason about the code.
Well, actually monadic I/O makes is easier to reason about code than
languages which allow for non-transparent side effects in functions. I
think you were making a really good argument pro monads yourself -- in
your C interpreter monad you can easily see what's making use of the C
interpreter (any function "in"/lifted to the C interpreter monad), and
what's not. Same for I/O -- you can assume that only functions
"in"/lifted to the IO monad (simply said, every value of type IO a)
are able to do I/O. This clearly allows easier reasoning about code.

- Michael