composewell / streamly

High performance, concurrent functional programming abstractions
https://streamly.composewell.com
Other
866 stars 66 forks source link

Breaking changes guide #1947

Closed adithyaov closed 1 year ago

adithyaov commented 2 years ago

Breaking changes guide

The following is all the information needed to create a breaking changes guide. We need to format this information properly. We also need to have proper examples to help users transition easily.

General notes

Streamly.Unicode.Stream

Changes

import Streamly.Prelude (adapt, IsStream)
import Streamly.Unicode.Stream as Unicode

encodeUtf8' :: (Monad m, IsStream t) => t m Char -> t m Word8
encodeUtf8' = Unicode.encodeUtf8' . adapt

encodeUtf8 :: (Monad m, IsStream t) => t m Char -> t m Word8
encodeUtf8 = Unicode.encodeUtf8 . adapt

encodeStrings :: (MonadIO m, IsStream t) => (SerialT m Char -> SerialT m Word8) -> t m String -> t m (Array Word8)
encodeStrings decoder = Unicode.encodeStrings decoder . adapt

encodeLatin1' :: (IsStream t, Monad m) => t m Char -> t m Word8
encodeLatin1' = Unicode.encodeLatin1' . adapt

encodeLatin1 :: (IsStream t, Monad m) => t m Char -> t m Word8
encodeLatin1 = Unicode.encodeLatin1 . adapt

decodeUtf8' :: (Monad m, IsStream t) => t m Word8 -> t m Char
decodeUtf8' = Unicode.decodeUtf8' . adapt

decodeUtf8 :: (Monad m, IsStream t) => t m Word8 -> t m Char
decodeUtf8 = Unicode.decodeUtf8 . adapt

decodeLatin1 :: (IsStream t, Monad m) => t m Word8 -> t m Char
decodeLatin1 = Unicode.decodeLatin1 . adapt

Streamly.Prelude

Notes

Streamly.Network.Socket

Code

import Streamly.Data.Array.Unboxed (Unbox)

Notes

Streamly.FileSystem.Handle

Notes

Streamly.Data.Unfold

Code

import Streamly.Prelude (adapt, IsStream)
import Streamly.Prelude as Stream
import Streamly.Data.Unfold as Unfold

Notes

replicateM

This should be changed to,

Stream.unfold (Unfold.replicateM i) seed

this,

Stream.unfold Unfold.replicateM (i, seed)

many

This should be changed to,

Unfold.many seeder expander

this,

Unfold.many expander seeder

fromStream

fromStream :: (IsStream t, Monad m) => Unfold m (t m a) a
fromStream = Unfold.lmap adapt Unfold.fromStream

Streamly.Data.Array.Foreign

Code

import Streamly.Data.Array.Unboxed (Unbox)

Notes

An additional Unbox constraint is required for the following APIs

adithyaov commented 1 year ago

This issue was for tracking the upgrading guide and the changelog. Can be closed.