Bifunctor instance for (,) is not strictly law-abiding

Edward Kmett ekmett at gmail.com
Wed Feb 17 21:24:23 UTC 2016


As a general rule we let the results of many operations be more defined
than the laws require.

Stream fusion runs into this exact same "issue".

This sort of thing is necessary to makes a lot of things like "lazy state"
and "lazy writer" possible at all.

-Edward

On Wed, Feb 17, 2016 at 2:25 PM, David Feuer <david.feuer at gmail.com> wrote:

> I don't think we should fix this, because it would break code, but I do
> think we should document it.
>
> Bifunctor law:
>
> bimap id id = id
>
> But actually,
>
> bimap id id _|_ = (_|_, _|_)
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20160217/1b89626e/attachment.html>


More information about the Libraries mailing list