Laws for Show and Read?
David Feuer
david.feuer at gmail.com
Wed Jun 5 19:15:00 UTC 2019
Double and Float instances are terminally broken in general. What's new?
On Wed, Jun 5, 2019, 2:56 PM Sven Panne <svenpanne at gmail.com> wrote:
> Am Mi., 5. Juni 2019 um 17:02 Uhr schrieb David Feuer <
> david.feuer at gmail.com>:
>
>> We already have the law
>>
>> read . show = id
>>
>> which implies the injectivity and surjectivity conditions you specify.
>>
>
> I think this doesn't hold for the standard Read/Show instances for
> Double/Float: IEEE-754 NaNs have a sign bit and a payload, and both parts
> are probably lost by the "read . show"-combination. The 2 infinities are
> probably OK, but what about -0 vs. +0?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20190605/02e0f0ab/attachment.html>
More information about the Libraries
mailing list