Re: Storable instance of () is broken
Sven Panne <[email protected]> Wed, 5 Jan 2022 11:51:14 +0100
| Newsgroups | gmane.comp.lang.haskell.libraries |
|---|---|
| Message-ID | <CANBN=mtytgV_YYRKCSgtAeAdM1ynZSKx8KnsCLf=bbxh95zcTg@mail.gmail.com> |
Am Mi., 5. Jan. 2022 um 11:40 Uhr schrieb Georgi Lyubenov < [email protected]>: > [...] However, here, trying to store undefined :: () is no different from > trying to store () :: (). Is this difference in behaviour with other > instances of Storable (where presumably trying to store undefined will blow > up, as there is indeed some work to do there) intentionally ignored? > Good point, this might be seen as a bug/inconsistency of Storable (): peek and poke are not strict in their arguments, while probably all(?) other instances are. But https://www.haskell.org/onlinereport/haskell2010/haskellch37.html doesn't require this, so I would be reluctant to really call this a bug. Changing this can have "interesting" effects on the ecosystem, too, who knows? Again, this would be a change where the compiler doesn't help you. Cheers, S. _______________________________________________ Libraries mailing list [email protected] http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries