[Haskell-cafe] Properties for Foldable

Sebastian Fischer fischer at nii.ac.jp
Sat Jul 30 00:40:37 CEST 2011


>  http://www.cs.ox.ac.uk/jeremy.gibbons/publications/iterator.pdf

Interesting. However I don't understand why the instance in Section
5.5 is not already forbidden by the "purity law"

    traverse pure = pure

and a "'no duplication' constraint" would be necessary. For example:

    traverse Id [1,2,3] = Id [1,1,2,2,3,3] /= Id [1,2,3]

What am I missing?

Can we derive Foldable laws from the Traversable laws?

Sebastian



More information about the Haskell-Cafe mailing list