
Ok, so I think there is a fairly wide consensus that the name ByteString is a pretty misleading historical naming mistake. On the other hand, I also realise bytestring is at the very core of the Haskell ecosystem and any breakage has to be avoided at all cost... So I was just wondering on IRC what (if any?) problems we'd run into if we released a "bytes" package that's just s/ByteString/Bytes of bytestring (Data.Bytes, Bytes type, etc) then turn bytestring into a hollow shell that just re-exports Data.Bytes as Data.ByteString, etc. and defines "type ByteString = Bytes". I realise there's no way we'll get rid of bytestring itself any time soon (if ever), but at least we could point new code and beginners at a less confusingly named type. Added bonus Bytes is considerably shorter to type! Cheers, Merijn

ByteString may not be the best way to represent a sequence of bytes, as it
contributes to heap fragmentation by using pinned memory.
Its primary use case should be FFI, and it's largely misused today.
If we rename it, let's call it "PinnedBytes", and use the name "Bytes" for
ShortByteString, ByteArray, or Array Word8
All the best,
Vlad
On Mon, Jan 7, 2019, 12:25 Merijn Verstraaten Ok, so I think there is a fairly wide consensus that the name ByteString
is a pretty misleading historical naming mistake. On the other hand, I also
realise bytestring is at the very core of the Haskell ecosystem and any
breakage has to be avoided at all cost... So I was just wondering on IRC what (if any?) problems we'd run into if we
released a "bytes" package that's just s/ByteString/Bytes of bytestring
(Data.Bytes, Bytes type, etc) then turn bytestring into a hollow shell that
just re-exports Data.Bytes as Data.ByteString, etc. and defines "type
ByteString = Bytes". I realise there's no way we'll get rid of bytestring itself any time soon
(if ever), but at least we could point new code and beginners at a less
confusingly named type. Added bonus Bytes is considerably shorter to type! Cheers,
Merijn
_______________________________________________
Libraries mailing list
Libraries@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

yeah, if it were to be renamed, those would be good ideas.
On Mon, Jan 7, 2019 at 4:35 AM Vladislav Zavialov
ByteString may not be the best way to represent a sequence of bytes, as it contributes to heap fragmentation by using pinned memory.
Its primary use case should be FFI, and it's largely misused today.
If we rename it, let's call it "PinnedBytes", and use the name "Bytes" for ShortByteString, ByteArray, or Array Word8
All the best, Vlad
On Mon, Jan 7, 2019, 12:25 Merijn Verstraaten
Ok, so I think there is a fairly wide consensus that the name ByteString is a pretty misleading historical naming mistake. On the other hand, I also realise bytestring is at the very core of the Haskell ecosystem and any breakage has to be avoided at all cost...
So I was just wondering on IRC what (if any?) problems we'd run into if we released a "bytes" package that's just s/ByteString/Bytes of bytestring (Data.Bytes, Bytes type, etc) then turn bytestring into a hollow shell that just re-exports Data.Bytes as Data.ByteString, etc. and defines "type ByteString = Bytes".
I realise there's no way we'll get rid of bytestring itself any time soon (if ever), but at least we could point new code and beginners at a less confusingly named type. Added bonus Bytes is considerably shorter to type!
Cheers, Merijn _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
participants (3)
-
Carter Schonwald
-
Merijn Verstraaten
-
Vladislav Zavialov