[Haskell-cafe] Textbook example of instance Foldable ((,) a)

David Feuer david.feuer at gmail.com
Mon Nov 23 15:24:10 UTC 2020


The expectation that length = getSum . foldMap (Sum . const 1)

On Mon, Nov 23, 2020, 10:21 AM Manuel Schneckenreither <
manuel.schnecki at gmail.com> wrote:

>     >>>>> "HT" == Henning Thielemann <lemming at henning-thielemann.de>
> writes:
>
>     HT> "length (a,b) == 1" is only a consequence of defining instance
>     HT> Foldable for pairs. It was not the argument to implement that
>     HT> instance, at all.
>
> What was the argument to use 1, not 2 for instance?
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20201123/f0b09518/attachment.html>


More information about the Haskell-Cafe mailing list