You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I often end up importing Data.ByteString.Lazy just for the sake of fromStrict / toStrict. It would be nice to re-export these two functions from Data.ByteString itself.
The text was updated successfully, but these errors were encountered:
Here is an example. My applications often deal with strict ByteString only:
importqualifiedData.ByteStringasB--- 100500 lines of codefoo::ByteString
foo =B.replicate9999
However, if I need to pass foo to Data.Aeson.decode, which expects lazy ByteString, things get messy. I have to jump up to the imports and add import qualified Data.ByteString.Lazy as BL only to reach out for fromStrict. (And potentially change as B to as BS for consistency, which means a ton of minor edits all over the file). There are several workarounds, but the switch of context is very annoying.
importqualifiedData.ByteStringasBSimportqualifiedData.ByteString.LazyasBL
bar = decode (BL.fromStrict foo)
I often end up importing
Data.ByteString.Lazy
just for the sake offromStrict
/toStrict
. It would be nice to re-export these two functions fromData.ByteString
itself.The text was updated successfully, but these errors were encountered: