On Fri 08 Oct, Wolfgang Lohmann wrote: 
> Monadic IO is not thought ( in my opinion) to have IO during 
> _the whole_ program, while preserving the referential transparency.
> Monads are fine to encapsulate effects, and so the IO Monad
> encapsulates input/output effects _to preserve_ the referential
> transparency of _the rest_ of the program. 

I would agree with this, even if we don't have referential transparency
within the IO monad. Although I don't believe we can accurately model
the outside world as a value and associated functions, it does stop the
rest of the program being polluted.

> A good program
> (IMHO) restricts the use of monads to where they are needed, to
> increase the sideeffect free part of the program. 

I guess what is or isn't good programming style is just a matter of taste.
But I don't think monads do any damage to side effect free parts of
a program. They are still purely functional (except the IO monad IMHO,
but I'm sure many people don't agree with me on this).

Regards
-- 
Adrian Hey




Reply via email to