
On 5 June 2011 11:28, Henning Thielemann
What do you think of it? Are there more laws that would be reasonable?
Jeremy Gibbons articulated a good set of laws, which unfortunately have not made their way into the documentation. See Section 5 of http://www.cs.ox.ac.uk/jeremy.gibbons/publications/iterator.pdf Paraphrasing, the laws are: 1. Identity (as you proposed): sequenceA . fmap Id = Id 2. Composition: sequenceA . fmap Comp = Comp . fmap sequenceA . sequenceA 3. Naturality. For "applicative functor transformation" phi, we have: sequenceA . fmap phi = phi ◦ sequenceA Where an applicative functor transformation phi :: m a -> n a is a function that respects: a) phi (pure a) = pure a b) phi (mf <*> mx) = phi mf <*> phi mx Cheers, Max