English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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.