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
People cannot use Stream-ish functions on AsyncT or ParallelT. They can
only use it on SerialT.
Users will need to adapt the stream type if anything other than SerialT.
Users will need to add an additional constraint along with Storable wherever
array-ish APIs are being used.
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
once: Deprecated in the previous release and removed in this one.
mergeBy: Monad constraint is removed.
each: Deprecated in the previous release and removed in this one.
Streamly.Network.Socket
Code
import Streamly.Data.Array.Unboxed (Unbox)
Notes
writeChunksWithBufferOf:
Deprecated in both, the previous and this release.
An additional Unbox constraint is required.
writeChunks: An additional Unbox constraint is required.
writeChunk: An additional Unbox constraint is required.
Streamly.FileSystem.Handle
Notes
writeChunks: Storable constraint is no longer required
putChunk: Storable constraint is no longer required
Streamly.Data.Unfold
Code
import Streamly.Prelude (adapt, IsStream)
import Streamly.Prelude as Stream
import Streamly.Data.Unfold as Unfold
Notes
take: Relaxed constraint Monad to Applicative.
repeatM: Relaxed constraint Monad to Applicative.
iterateM: Relaxed constraint Monad to Applicative.
fromListM: Relaxed constraint Monad to Applicative.
fromList: Relaxed constraint Monad to Applicative.
drop: Relaxed constraint Monad to Applicative.
replicateM
Relaxed constraint Monad to Applicative.
Changed signature.
replicateM :: Monad m => Int -> Unfold m (m a) a is changed to replicateM:: Applicative m => Unfold m (Int, m a) a
This should be changed to,
Stream.unfold (Unfold.replicateM i) seed
this,
Stream.unfold Unfold.replicateM (i, seed)
many
Order of the arguments is changed
many :: Monad m => Unfold m a b -> Unfold m b c -> Unfold m a c is changed
to many :: Monad m => Unfold m b c -> Unfold m a b -> Unfold m a c.
This should be changed to,
Unfold.many seeder expander
this,
Unfold.many expander seeder
fromStream
Relaxed constraint Monad to Applicative.
Need to lmapadapt if the seed is anything other than a SerialT stream.
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
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
Stream
-ish functions onAsyncT
orParallelT
. They can only use it onSerialT
.adapt
the stream type if anything other thanSerialT
.Storable
wherever array-ish APIs are being used.Streamly.Unicode.Stream
Changes
Streamly.Prelude
Notes
once
: Deprecated in the previous release and removed in this one.mergeBy
:Monad
constraint is removed.each
: Deprecated in the previous release and removed in this one.Streamly.Network.Socket
Code
Notes
writeChunksWithBufferOf
:Unbox
constraint is required.writeChunks
: An additionalUnbox
constraint is required.writeChunk
: An additionalUnbox
constraint is required.Streamly.FileSystem.Handle
Notes
writeChunks
:Storable
constraint is no longer requiredputChunk
:Storable
constraint is no longer requiredStreamly.Data.Unfold
Code
Notes
take
: Relaxed constraintMonad
toApplicative
.repeatM
: Relaxed constraintMonad
toApplicative
.iterateM
: Relaxed constraintMonad
toApplicative
.fromListM
: Relaxed constraintMonad
toApplicative
.fromList
: Relaxed constraintMonad
toApplicative
.drop
: Relaxed constraintMonad
toApplicative
.replicateM
Monad
toApplicative
.replicateM :: Monad m => Int -> Unfold m (m a) a
is changed toreplicateM:: Applicative m => Unfold m (Int, m a) a
This should be changed to,
this,
many
many :: Monad m => Unfold m a b -> Unfold m b c -> Unfold m a c
is changed tomany :: Monad m => Unfold m b c -> Unfold m a b -> Unfold m a c
.This should be changed to,
this,
fromStream
Monad
toApplicative
.lmap
adapt
if the seed is anything other than aSerialT
stream.Streamly.Data.Array.Foreign
Code
Notes
An additional
Unbox
constraint is required for the following APIswriteN
writeLastN
write
toList
readRev
read
length
getIndex
fromListN
fromList
cast