[Haskell-cafe] Re: How to do this in FP way?
Achim Schneider
barsoap at web.de
Mon Jun 16 15:11:11 EDT 2008
Henning Thielemann <lemming at henning-thielemann.de> wrote:
>
> On Mon, 16 Jun 2008, Achim Schneider wrote:
>
> > We have to resort to IO actions to get the time, and to IORefs
> > because we need to chain up different calls to getCurrentTime using
> > the IO Monad. The rest of the program can work with whatever you
> > like best.
>
> Isn't (StateT s IO a) the cleaner alternative to IORef?
>
Yes. But then using one IORef in one place won't make your program
harder to understand, using Monad transformers quite certainly will.
Admittedly, I'm becoming dodgy.
--
(c) this sig last receiving data processing entity. Inspect headers for
past copyright information. All rights reserved. Unauthorised copying,
hiring, renting, public performance and/or broadcasting of this
signature prohibited.
More information about the Haskell-Cafe
mailing list