[Haskell-cafe] Re: Is lazyness make big difference?
Allan Clark
a.d.clark at ed.ac.uk
Thu Feb 15 08:07:34 EST 2007
> i.e. to use Monad.Writer in stead of Monad.State. The point is that for
> example 'typedProgram' does not really depend on the contents of 'log',
> but the dependencies in your code don't express this. One should switch from
>
> Log -> (a, Log)
>
> to
>
> (a, Log -> Log)
>
> or even
>
> (a, Log)
>
> if Log already has a natural monoid structure.
Yes of course you're quite right, in general I would have the last
version ie (a, Log).
I did not wish to muddy the example, but probably it was not helpful to
have 'typedProgram' depend on the contents of 'log'.
regards
allan
More information about the Haskell-Cafe
mailing list