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 (11:31)
From: Martin Berger <martinb@d...>
Subject: Re: [Caml-list] environment idiom
it is quite simple: of course the monadic IO that has been discussed
has side-effects. hence it is not funcitonal. but -- and that's a big
but -- what the monadic types do is: LIMIT composability in a way that
no typable context can OBSERVE the statefulness of the monadic code.
an external observer, not bound to the typing discipline, can observe
the stateful behaviour.

more generally: the question of whether a code fragment is  functional
or not is meaningless without specifying the class of admissable
observations, i.e. the class of admissible context. any programming
language becomes functional for example if the class of contexts is
generated by

    C[.] ::= SKIP | x := n | [.]

or something silly like that.