Re: Storable instance of () is broken
Sven Panne <[email protected]> Wed, 5 Jan 2022 13:12:32 +0100
| Newsgroups | gmane.comp.lang.haskell.libraries |
|---|---|
| Message-ID | <CANBN=mun86synDBe-hszK551VCE+2jcfi92gpTBJ=-az4nCtHg@mail.gmail.com> |
Am Mi., 5. Jan. 2022 um 12:42 Uhr schrieb David Feuer <[email protected] >: > No. Consider a type like this: > > data Foo a = Foo !Int !a > > instance Storable a => Storable (Foo a) where ... > > Now if a happens to be (), we pay only one word per Foo. [...] > This is exactly the kind of breakage I had in mind: With the proposed change, the storage layout would change, and the compiler wouldn't warn you about that at all. Note that I'm not arguing about memory efficiency, it's all about a subtle semantic change for the sake of a single library, wanting to change something which was in place for 10-20 years. Seems like an extremely bad move from the POV of the Haskell ecosystem: It's exactly this kind of ad hoc changes which annoys people. _______________________________________________ Libraries mailing list [email protected] http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries