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


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to