[Haskell-cafe] Re: A question about "monad laws"
apfelmus
apfelmus at quantentunnel.de
Tue Feb 12 09:56:53 EST 2008
Yitzchak Gale wrote:
> Ben Franksen wrote:
>> ...and the Unimo paper[1] explains how to easily write a 'correct' ListT.
>
> Are you sure? Maybe I am missing something, but I don't
> see any claim that the Unimo ListT satisfies the laws any
> more than the old mtl ListT.
> ListT-Done-Right could also be defined via the Unimo
> framework, and then it would satisfy the monad laws.
The list monad transformer implemented with Unimo (figure 13) is
different from ListT m a = m [a] (figure 11 for reference).
Note that I say "the list monad transformer".
I don't understand what's so special about "ListT m does not fulfill the
monad laws", it just shows that naïvely using m [a] to implement the
list monad transformer is incorrect for general m . In other words,
there is a big bug in Control.Monad.List and that's all there is to it.
Regards,
apfelmus
More information about the Haskell-Cafe
mailing list