From 5327f181db2cf956461b74ed50720eebf119f25a Mon Sep 17 00:00:00 2001 From: Adithya Kumar Date: Wed, 19 Oct 2022 22:55:46 +0530 Subject: [PATCH] Deprecate Streamly.Prelude & S.Internal.Data.Stream.IsStream.* --- benchmark/NanoBenchmarks.hs | 2 ++ benchmark/Streamly/Benchmark/Data/Array.hs | 2 ++ benchmark/Streamly/Benchmark/Data/Array/SmallArray.hs | 2 ++ .../Streamly/Benchmark/Data/Array/Stream/Unboxed.hs | 2 ++ benchmark/Streamly/Benchmark/Data/Array/Unboxed.hs | 2 ++ .../Streamly/Benchmark/Data/Array/Unboxed/Mut.hs | 2 ++ benchmark/Streamly/Benchmark/Data/Fold/Window.hs | 2 ++ benchmark/Streamly/Benchmark/Data/Parser.hs | 2 ++ benchmark/Streamly/Benchmark/Data/Parser/ParserD.hs | 2 ++ benchmark/Streamly/Benchmark/Data/Stream/Common.hs | 4 ++++ benchmark/Streamly/Benchmark/Data/Stream/Eliminate.hs | 4 ++++ .../Streamly/Benchmark/Data/Stream/Exceptions.hs | 4 ++++ benchmark/Streamly/Benchmark/Data/Stream/Expand.hs | 4 ++++ benchmark/Streamly/Benchmark/Data/Stream/Generate.hs | 4 ++++ benchmark/Streamly/Benchmark/Data/Stream/Lift.hs | 4 ++++ benchmark/Streamly/Benchmark/Data/Stream/Reduce.hs | 4 ++++ benchmark/Streamly/Benchmark/Data/Stream/Split.hs | 2 ++ benchmark/Streamly/Benchmark/Data/Stream/StreamDK.hs | 2 ++ benchmark/Streamly/Benchmark/Data/Stream/Transform.hs | 4 ++++ .../Streamly/Benchmark/FileSystem/Handle/Read.hs | 2 ++ .../Streamly/Benchmark/FileSystem/Handle/ReadWrite.hs | 2 ++ benchmark/Streamly/Benchmark/Prelude/Adaptive.hs | 2 ++ benchmark/Streamly/Benchmark/Prelude/Ahead.hs | 2 ++ benchmark/Streamly/Benchmark/Prelude/Async.hs | 2 ++ benchmark/Streamly/Benchmark/Prelude/Concurrent.hs | 1 + benchmark/Streamly/Benchmark/Prelude/Merge.hs | 2 ++ benchmark/Streamly/Benchmark/Prelude/Parallel.hs | 2 ++ benchmark/Streamly/Benchmark/Prelude/Rate.hs | 1 + benchmark/Streamly/Benchmark/Prelude/WAsync.hs | 2 ++ benchmark/Streamly/Benchmark/Prelude/WSerial.hs | 2 ++ benchmark/Streamly/Benchmark/Prelude/ZipAsync.hs | 2 ++ benchmark/Streamly/Benchmark/Prelude/ZipSerial.hs | 2 ++ benchmark/Streamly/Benchmark/Unicode/Char.hs | 2 ++ benchmark/Streamly/Benchmark/Unicode/Stream.hs | 2 ++ benchmark/lib/Streamly/Benchmark/Prelude.hs | 2 ++ core/src/Streamly/Internal/FileSystem/Handle.hs | 6 +++--- core/src/Streamly/Internal/Unicode/Array/Char.hs | 11 ++++++----- core/src/Streamly/Internal/Unicode/Stream.hs | 6 +++--- docs/User/Tutorials/ConcurrentStreams.hs | 5 ++++- docs/User/Tutorials/ReactiveProgramming.hs | 2 +- docs/User/Tutorials/Tutorial.hs | 5 ++++- src/Streamly.hs | 2 ++ src/Streamly/Data/Array/Foreign.hs | 1 + src/Streamly/Internal/Data/Fold/Async.hs | 1 + src/Streamly/Internal/Data/Stream/Ahead.hs | 1 + src/Streamly/Internal/Data/Stream/Async.hs | 1 + src/Streamly/Internal/Data/Stream/IsStream.hs | 4 +++- .../Internal/Data/Stream/IsStream/Combinators.hs | 4 +++- src/Streamly/Internal/Data/Stream/IsStream/Common.hs | 4 +++- .../Internal/Data/Stream/IsStream/Eliminate.hs | 5 ++++- .../Internal/Data/Stream/IsStream/Enumeration.hs | 5 ++++- .../Internal/Data/Stream/IsStream/Exception.hs | 5 ++++- src/Streamly/Internal/Data/Stream/IsStream/Expand.hs | 5 ++++- .../Internal/Data/Stream/IsStream/Generate.hs | 4 +++- src/Streamly/Internal/Data/Stream/IsStream/Lift.hs | 4 +++- src/Streamly/Internal/Data/Stream/IsStream/Reduce.hs | 5 ++++- src/Streamly/Internal/Data/Stream/IsStream/Top.hs | 5 ++++- .../Internal/Data/Stream/IsStream/Transform.hs | 5 ++++- src/Streamly/Internal/Data/Stream/IsStream/Type.hs | 3 ++- src/Streamly/Internal/Data/Stream/Serial.hs | 1 + src/Streamly/Internal/Data/Stream/Zip/Concurrent.hs | 3 ++- src/Streamly/Internal/Data/Stream/ZipAsync.hs | 1 + src/Streamly/Internal/Network/Inet/TCP.hs | 5 +++-- src/Streamly/Internal/Unicode/Char.hs | 11 ++++++++--- src/Streamly/Internal/Unicode/Utf8.hs | 11 +++++++---- src/Streamly/Prelude.hs | 4 +++- test/Streamly/Test/Data/Array.hs | 2 ++ test/Streamly/Test/Data/Array/Stream/Unboxed.hs | 2 ++ test/Streamly/Test/Data/SmallArray.hs | 2 ++ test/Streamly/Test/FileSystem/Event/Common.hs | 2 ++ test/Streamly/Test/Network/Inet/TCP.hs | 2 ++ test/Streamly/Test/Network/Socket.hs | 2 ++ test/Streamly/Test/Prelude.hs | 2 ++ test/Streamly/Test/Prelude/Ahead.hs | 2 ++ test/Streamly/Test/Prelude/Async.hs | 2 ++ test/Streamly/Test/Prelude/Concurrent.hs | 2 ++ test/Streamly/Test/Prelude/Fold.hs | 2 ++ test/Streamly/Test/Prelude/Parallel.hs | 2 ++ test/Streamly/Test/Prelude/Rate.hs | 2 ++ test/Streamly/Test/Prelude/Serial.hs | 2 ++ test/Streamly/Test/Prelude/Top.hs | 2 ++ test/Streamly/Test/Prelude/WAsync.hs | 2 ++ test/Streamly/Test/Prelude/WSerial.hs | 2 ++ test/Streamly/Test/Prelude/ZipAsync.hs | 2 ++ test/Streamly/Test/Prelude/ZipSerial.hs | 2 ++ test/Streamly/Test/Unicode/Stream.hs | 2 ++ test/lib/Streamly/Test/Prelude/Common.hs | 2 ++ 87 files changed, 223 insertions(+), 38 deletions(-) diff --git a/benchmark/NanoBenchmarks.hs b/benchmark/NanoBenchmarks.hs index 7047567c..bb3bd176 100644 --- a/benchmark/NanoBenchmarks.hs +++ b/benchmark/NanoBenchmarks.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + ------------------------------------------------------------------------------- -- Investigate specific benchmarks more closely in isolation, possibly looking -- at GHC generated code for optimizing specific problematic cases. diff --git a/benchmark/Streamly/Benchmark/Data/Array.hs b/benchmark/Streamly/Benchmark/Data/Array.hs index f0d3498d..22c88e97 100644 --- a/benchmark/Streamly/Benchmark/Data/Array.hs +++ b/benchmark/Streamly/Benchmark/Data/Array.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + {-# LANGUAGE CPP #-} #include "Streamly/Benchmark/Data/Array/CommonImports.hs" diff --git a/benchmark/Streamly/Benchmark/Data/Array/SmallArray.hs b/benchmark/Streamly/Benchmark/Data/Array/SmallArray.hs index 845c9964..4d68a43a 100644 --- a/benchmark/Streamly/Benchmark/Data/Array/SmallArray.hs +++ b/benchmark/Streamly/Benchmark/Data/Array/SmallArray.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + {-# LANGUAGE CPP #-} #include "Streamly/Benchmark/Data/Array/CommonImports.hs" diff --git a/benchmark/Streamly/Benchmark/Data/Array/Stream/Unboxed.hs b/benchmark/Streamly/Benchmark/Data/Array/Stream/Unboxed.hs index 8922205f..a5350ad7 100644 --- a/benchmark/Streamly/Benchmark/Data/Array/Stream/Unboxed.hs +++ b/benchmark/Streamly/Benchmark/Data/Array/Stream/Unboxed.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Benchmark.Data.ParserD -- Copyright : (c) 2020 Composewell Technologies diff --git a/benchmark/Streamly/Benchmark/Data/Array/Unboxed.hs b/benchmark/Streamly/Benchmark/Data/Array/Unboxed.hs index 710f700b..0aa03051 100644 --- a/benchmark/Streamly/Benchmark/Data/Array/Unboxed.hs +++ b/benchmark/Streamly/Benchmark/Data/Array/Unboxed.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + {-# LANGUAGE CPP #-} #include "Streamly/Benchmark/Data/Array/CommonImports.hs" diff --git a/benchmark/Streamly/Benchmark/Data/Array/Unboxed/Mut.hs b/benchmark/Streamly/Benchmark/Data/Array/Unboxed/Mut.hs index 3e174e93..e974de21 100644 --- a/benchmark/Streamly/Benchmark/Data/Array/Unboxed/Mut.hs +++ b/benchmark/Streamly/Benchmark/Data/Array/Unboxed/Mut.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Benchmark.Data.Array.Unboxed.Mut -- Copyright : (c) 2021 Composewell Technologies diff --git a/benchmark/Streamly/Benchmark/Data/Fold/Window.hs b/benchmark/Streamly/Benchmark/Data/Fold/Window.hs index 99eab0d2..4195d2b2 100644 --- a/benchmark/Streamly/Benchmark/Data/Fold/Window.hs +++ b/benchmark/Streamly/Benchmark/Data/Fold/Window.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + module Main (main) where import Control.DeepSeq (NFData) diff --git a/benchmark/Streamly/Benchmark/Data/Parser.hs b/benchmark/Streamly/Benchmark/Data/Parser.hs index 8a1bec08..c6ae2603 100644 --- a/benchmark/Streamly/Benchmark/Data/Parser.hs +++ b/benchmark/Streamly/Benchmark/Data/Parser.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Benchmark.Data.Parser -- Copyright : (c) 2020 Composewell Technologies diff --git a/benchmark/Streamly/Benchmark/Data/Parser/ParserD.hs b/benchmark/Streamly/Benchmark/Data/Parser/ParserD.hs index 25b7193b..a1423a72 100644 --- a/benchmark/Streamly/Benchmark/Data/Parser/ParserD.hs +++ b/benchmark/Streamly/Benchmark/Data/Parser/ParserD.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Benchmark.Data.ParserD -- Copyright : (c) 2020 Composewell Technologies diff --git a/benchmark/Streamly/Benchmark/Data/Stream/Common.hs b/benchmark/Streamly/Benchmark/Data/Stream/Common.hs index 162fa161..8076fea1 100644 --- a/benchmark/Streamly/Benchmark/Data/Stream/Common.hs +++ b/benchmark/Streamly/Benchmark/Data/Stream/Common.hs @@ -9,6 +9,10 @@ -- License : BSD-3-Clause -- Maintainer : streamly@composewell.com +#ifdef USE_PRELUDE +{-# OPTIONS_GHC -Wno-deprecations #-} +#endif + module Stream.Common ( MonadAsync diff --git a/benchmark/Streamly/Benchmark/Data/Stream/Eliminate.hs b/benchmark/Streamly/Benchmark/Data/Stream/Eliminate.hs index 3bed3d04..9cb9fb79 100644 --- a/benchmark/Streamly/Benchmark/Data/Stream/Eliminate.hs +++ b/benchmark/Streamly/Benchmark/Data/Stream/Eliminate.hs @@ -9,6 +9,10 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RankNTypes #-} +#ifdef USE_PRELUDE +{-# OPTIONS_GHC -Wno-deprecations #-} +#endif + #ifdef __HADDOCK_VERSION__ #undef INSPECTION #endif diff --git a/benchmark/Streamly/Benchmark/Data/Stream/Exceptions.hs b/benchmark/Streamly/Benchmark/Data/Stream/Exceptions.hs index 1144c233..2734dfb7 100644 --- a/benchmark/Streamly/Benchmark/Data/Stream/Exceptions.hs +++ b/benchmark/Streamly/Benchmark/Data/Stream/Exceptions.hs @@ -10,6 +10,10 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} +#ifdef USE_PRELUDE +{-# OPTIONS_GHC -Wno-deprecations #-} +#endif + #ifdef __HADDOCK_VERSION__ #undef INSPECTION #endif diff --git a/benchmark/Streamly/Benchmark/Data/Stream/Expand.hs b/benchmark/Streamly/Benchmark/Data/Stream/Expand.hs index dd5797a1..63fca9e1 100644 --- a/benchmark/Streamly/Benchmark/Data/Stream/Expand.hs +++ b/benchmark/Streamly/Benchmark/Data/Stream/Expand.hs @@ -10,6 +10,10 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TupleSections #-} +#ifdef USE_PRELUDE +{-# OPTIONS_GHC -Wno-deprecations #-} +#endif + #ifdef __HADDOCK_VERSION__ #undef INSPECTION #endif diff --git a/benchmark/Streamly/Benchmark/Data/Stream/Generate.hs b/benchmark/Streamly/Benchmark/Data/Stream/Generate.hs index 95654e0c..f33d6c7e 100644 --- a/benchmark/Streamly/Benchmark/Data/Stream/Generate.hs +++ b/benchmark/Streamly/Benchmark/Data/Stream/Generate.hs @@ -9,6 +9,10 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RankNTypes #-} +#ifdef USE_PRELUDE +{-# OPTIONS_GHC -Wno-deprecations #-} +#endif + module Stream.Generate (benchmarks) where import Data.Functor.Identity (Identity) diff --git a/benchmark/Streamly/Benchmark/Data/Stream/Lift.hs b/benchmark/Streamly/Benchmark/Data/Stream/Lift.hs index 2ec4406a..98edda35 100644 --- a/benchmark/Streamly/Benchmark/Data/Stream/Lift.hs +++ b/benchmark/Streamly/Benchmark/Data/Stream/Lift.hs @@ -9,6 +9,10 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RankNTypes #-} +#ifdef USE_PRELUDE +{-# OPTIONS_GHC -Wno-deprecations #-} +#endif + module Stream.Lift (benchmarks) where import Control.DeepSeq (NFData(..)) diff --git a/benchmark/Streamly/Benchmark/Data/Stream/Reduce.hs b/benchmark/Streamly/Benchmark/Data/Stream/Reduce.hs index 8dbea65b..ccd839e3 100644 --- a/benchmark/Streamly/Benchmark/Data/Stream/Reduce.hs +++ b/benchmark/Streamly/Benchmark/Data/Stream/Reduce.hs @@ -11,6 +11,10 @@ {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE RankNTypes #-} +#ifdef USE_PRELUDE +{-# OPTIONS_GHC -Wno-deprecations #-} +#endif + module Stream.Reduce (benchmarks) where import Control.DeepSeq (NFData(..)) diff --git a/benchmark/Streamly/Benchmark/Data/Stream/Split.hs b/benchmark/Streamly/Benchmark/Data/Stream/Split.hs index 08abd974..dcc7266b 100644 --- a/benchmark/Streamly/Benchmark/Data/Stream/Split.hs +++ b/benchmark/Streamly/Benchmark/Data/Stream/Split.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Stream.Split -- Copyright : (c) 2019 Composewell Technologies diff --git a/benchmark/Streamly/Benchmark/Data/Stream/StreamDK.hs b/benchmark/Streamly/Benchmark/Data/Stream/StreamDK.hs index 09b36f5c..25437ea3 100644 --- a/benchmark/Streamly/Benchmark/Data/Stream/StreamDK.hs +++ b/benchmark/Streamly/Benchmark/Data/Stream/StreamDK.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Benchmark.Data.Stream.StreamDK -- Copyright : (c) 2018 Composewell Technologies diff --git a/benchmark/Streamly/Benchmark/Data/Stream/Transform.hs b/benchmark/Streamly/Benchmark/Data/Stream/Transform.hs index 209f5e16..472ebbfc 100644 --- a/benchmark/Streamly/Benchmark/Data/Stream/Transform.hs +++ b/benchmark/Streamly/Benchmark/Data/Stream/Transform.hs @@ -9,6 +9,10 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RankNTypes #-} +#ifdef USE_PRELUDE +{-# OPTIONS_GHC -Wno-deprecations #-} +#endif + #ifdef __HADDOCK_VERSION__ #undef INSPECTION #endif diff --git a/benchmark/Streamly/Benchmark/FileSystem/Handle/Read.hs b/benchmark/Streamly/Benchmark/FileSystem/Handle/Read.hs index ec5d7820..b2ec159d 100644 --- a/benchmark/Streamly/Benchmark/FileSystem/Handle/Read.hs +++ b/benchmark/Streamly/Benchmark/FileSystem/Handle/Read.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Benchmark.FileSystem.Handle -- Copyright : (c) 2019 Composewell Technologies diff --git a/benchmark/Streamly/Benchmark/FileSystem/Handle/ReadWrite.hs b/benchmark/Streamly/Benchmark/FileSystem/Handle/ReadWrite.hs index b1ec3356..29b6603c 100644 --- a/benchmark/Streamly/Benchmark/FileSystem/Handle/ReadWrite.hs +++ b/benchmark/Streamly/Benchmark/FileSystem/Handle/ReadWrite.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Benchmark.FileSystem.Handle -- Copyright : (c) 2019 Composewell Technologies diff --git a/benchmark/Streamly/Benchmark/Prelude/Adaptive.hs b/benchmark/Streamly/Benchmark/Prelude/Adaptive.hs index a3ad00ca..cc50d9ef 100644 --- a/benchmark/Streamly/Benchmark/Prelude/Adaptive.hs +++ b/benchmark/Streamly/Benchmark/Prelude/Adaptive.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Main -- Copyright : (c) 2018 Composewell Technologies diff --git a/benchmark/Streamly/Benchmark/Prelude/Ahead.hs b/benchmark/Streamly/Benchmark/Prelude/Ahead.hs index a70f7cf3..b1866176 100644 --- a/benchmark/Streamly/Benchmark/Prelude/Ahead.hs +++ b/benchmark/Streamly/Benchmark/Prelude/Ahead.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Main -- Copyright : (c) 2018 Composewell Technologies diff --git a/benchmark/Streamly/Benchmark/Prelude/Async.hs b/benchmark/Streamly/Benchmark/Prelude/Async.hs index f3d73a67..6857338b 100644 --- a/benchmark/Streamly/Benchmark/Prelude/Async.hs +++ b/benchmark/Streamly/Benchmark/Prelude/Async.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Main -- Copyright : (c) 2018 Composewell Technologies diff --git a/benchmark/Streamly/Benchmark/Prelude/Concurrent.hs b/benchmark/Streamly/Benchmark/Prelude/Concurrent.hs index 12f47771..e80936b0 100644 --- a/benchmark/Streamly/Benchmark/Prelude/Concurrent.hs +++ b/benchmark/Streamly/Benchmark/Prelude/Concurrent.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} {-# LANGUAGE CPP #-} {-# LANGUAGE RankNTypes #-} -- | diff --git a/benchmark/Streamly/Benchmark/Prelude/Merge.hs b/benchmark/Streamly/Benchmark/Prelude/Merge.hs index dcb42c1b..3f1e0ee4 100644 --- a/benchmark/Streamly/Benchmark/Prelude/Merge.hs +++ b/benchmark/Streamly/Benchmark/Prelude/Merge.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Main -- Copyright : (c) 2018 Composewell Technologies diff --git a/benchmark/Streamly/Benchmark/Prelude/Parallel.hs b/benchmark/Streamly/Benchmark/Prelude/Parallel.hs index fd950bfa..bdb7aab5 100644 --- a/benchmark/Streamly/Benchmark/Prelude/Parallel.hs +++ b/benchmark/Streamly/Benchmark/Prelude/Parallel.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Main -- Copyright : (c) 2018 Composewell Technologies diff --git a/benchmark/Streamly/Benchmark/Prelude/Rate.hs b/benchmark/Streamly/Benchmark/Prelude/Rate.hs index 9a03d0fa..e958065f 100644 --- a/benchmark/Streamly/Benchmark/Prelude/Rate.hs +++ b/benchmark/Streamly/Benchmark/Prelude/Rate.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} {-# LANGUAGE FlexibleContexts #-} -- | diff --git a/benchmark/Streamly/Benchmark/Prelude/WAsync.hs b/benchmark/Streamly/Benchmark/Prelude/WAsync.hs index fd2fc915..4ebdbe75 100644 --- a/benchmark/Streamly/Benchmark/Prelude/WAsync.hs +++ b/benchmark/Streamly/Benchmark/Prelude/WAsync.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Main -- Copyright : (c) 2018 Composewell Technologies diff --git a/benchmark/Streamly/Benchmark/Prelude/WSerial.hs b/benchmark/Streamly/Benchmark/Prelude/WSerial.hs index d365bedf..7d85029e 100644 --- a/benchmark/Streamly/Benchmark/Prelude/WSerial.hs +++ b/benchmark/Streamly/Benchmark/Prelude/WSerial.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Main -- Copyright : (c) 2018 Composewell Technologies diff --git a/benchmark/Streamly/Benchmark/Prelude/ZipAsync.hs b/benchmark/Streamly/Benchmark/Prelude/ZipAsync.hs index 54e24fa1..10b60947 100644 --- a/benchmark/Streamly/Benchmark/Prelude/ZipAsync.hs +++ b/benchmark/Streamly/Benchmark/Prelude/ZipAsync.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Main -- Copyright : (c) 2018 Composewell Technologies diff --git a/benchmark/Streamly/Benchmark/Prelude/ZipSerial.hs b/benchmark/Streamly/Benchmark/Prelude/ZipSerial.hs index d3fabcb5..8039a2b9 100644 --- a/benchmark/Streamly/Benchmark/Prelude/ZipSerial.hs +++ b/benchmark/Streamly/Benchmark/Prelude/ZipSerial.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Main -- Copyright : (c) 2018 Composewell Technologies diff --git a/benchmark/Streamly/Benchmark/Unicode/Char.hs b/benchmark/Streamly/Benchmark/Unicode/Char.hs index e42b33b2..6f9eccf8 100644 --- a/benchmark/Streamly/Benchmark/Unicode/Char.hs +++ b/benchmark/Streamly/Benchmark/Unicode/Char.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- -- Module : Streamly.Unicode.Char -- Copyright : (c) 2021 Composewell Technologies diff --git a/benchmark/Streamly/Benchmark/Unicode/Stream.hs b/benchmark/Streamly/Benchmark/Unicode/Stream.hs index ee44b9ea..55e067ae 100644 --- a/benchmark/Streamly/Benchmark/Unicode/Stream.hs +++ b/benchmark/Streamly/Benchmark/Unicode/Stream.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- -- Module : Streamly.Unicode.Stream -- Copyright : (c) 2019 Composewell Technologies diff --git a/benchmark/lib/Streamly/Benchmark/Prelude.hs b/benchmark/lib/Streamly/Benchmark/Prelude.hs index 0881e5d1..623808f5 100644 --- a/benchmark/lib/Streamly/Benchmark/Prelude.hs +++ b/benchmark/lib/Streamly/Benchmark/Prelude.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Benchmark.Prelude -- Copyright : (c) 2018 Composewell Technologies diff --git a/core/src/Streamly/Internal/FileSystem/Handle.hs b/core/src/Streamly/Internal/FileSystem/Handle.hs index c71d77ac..2b6365f4 100644 --- a/core/src/Streamly/Internal/FileSystem/Handle.hs +++ b/core/src/Streamly/Internal/FileSystem/Handle.hs @@ -146,10 +146,10 @@ import qualified Streamly.Internal.Data.Stream.StreamK.Type as K (mkStream) -- >>> import qualified Streamly.Data.Array.Unboxed as Array -- >>> import qualified Streamly.Data.Fold as Fold -- >>> import qualified Streamly.Data.Unfold as Unfold --- >>> import qualified Streamly.Prelude as Stream +-- >>> import qualified Streamly.Data.Stream as Stream -- -- >>> import qualified Streamly.Internal.Data.Array.Unboxed.Type as Array (writeNUnsafe) --- >>> import qualified Streamly.Internal.Data.Stream.IsStream as Stream +-- >>> import qualified Streamly.Internal.Data.Stream as Stream -- >>> import qualified Streamly.Internal.Data.Unfold as Unfold (first) -- >>> import qualified Streamly.Internal.FileSystem.Handle as Handle -- >>> import qualified Streamly.Internal.System.IO as IO (defaultChunkSize) @@ -410,7 +410,7 @@ putChunk h arr = A.asPtrUnsafe arr $ \ptr -> -- XXX use an unfold to fromObjects or fromUnfold so that we can put any object -- | Write a stream of arrays to a handle. -- --- >>> putChunks h = Stream.mapM_ (Handle.putChunk h) +-- >>> putChunks h = Stream.fold (Fold.drainBy (Handle.putChunk h)) -- -- @since 0.7.0 {-# INLINE putChunks #-} diff --git a/core/src/Streamly/Internal/Unicode/Array/Char.hs b/core/src/Streamly/Internal/Unicode/Array/Char.hs index d4baa8ba..ca080ccf 100644 --- a/core/src/Streamly/Internal/Unicode/Array/Char.hs +++ b/core/src/Streamly/Internal/Unicode/Array/Char.hs @@ -30,7 +30,8 @@ import Prelude hiding (String, lines, words, unlines, unwords) -- >>> :m -- >>> :set -XOverloadedStrings -- >>> import Prelude hiding (String, lines, words, unlines, unwords) --- >>> import qualified Streamly.Prelude as Stream +-- >>> import qualified Streamly.Data.Stream as Stream +-- >>> import qualified Streamly.Data.Fold as Fold -- >>> import qualified Streamly.Internal.Unicode.Array.Char as Unicode -- | Break a string up into a stream of strings at newline characters. @@ -38,7 +39,7 @@ import Prelude hiding (String, lines, words, unlines, unwords) -- -- > lines = S.lines A.write -- --- >>> Stream.toList $ Unicode.lines $ Stream.fromList "lines\nthis\nstring\n\n\n" +-- >>> Stream.fold Fold.toList $ Unicode.lines $ Stream.fromList "lines\nthis\nstring\n\n\n" -- ["lines","this","string","",""] -- {-# INLINE lines #-} @@ -50,7 +51,7 @@ lines = S.lines A.write -- -- > words = S.words A.write -- --- >>> Stream.toList $ Unicode.words $ Stream.fromList "A newline\nis considered white space?" +-- >>> Stream.fold Fold.toList $ Unicode.words $ Stream.fromList "A newline\nis considered white space?" -- ["A","newline","is","considered","white","space?"] -- {-# INLINE words #-} @@ -62,7 +63,7 @@ words = S.words A.write -- -- 'unlines' is an inverse operation to 'lines'. -- --- >>> Stream.toList $ Unicode.unlines $ Stream.fromList ["lines", "this", "string"] +-- >>> Stream.fold Fold.toList $ Unicode.unlines $ Stream.fromList ["lines", "this", "string"] -- "lines\nthis\nstring\n" -- -- > unlines = S.unlines A.read @@ -79,7 +80,7 @@ unlines = S.unlines A.reader -- -- 'unwords' is an inverse operation to 'words'. -- --- >>> Stream.toList $ Unicode.unwords $ Stream.fromList ["unwords", "this", "string"] +-- >>> Stream.fold Fold.toList $ Unicode.unwords $ Stream.fromList ["unwords", "this", "string"] -- "unwords this string" -- -- > unwords = S.unwords A.read diff --git a/core/src/Streamly/Internal/Unicode/Stream.hs b/core/src/Streamly/Internal/Unicode/Stream.hs index 6d9fe29a..98c3f2c3 100644 --- a/core/src/Streamly/Internal/Unicode/Stream.hs +++ b/core/src/Streamly/Internal/Unicode/Stream.hs @@ -128,7 +128,7 @@ import Prelude hiding (lines, words, unlines, unwords) -- >>> :m -- >>> :set -XMagicHash -- >>> import Prelude hiding (lines, words, unlines, unwords) --- >>> import qualified Streamly.Prelude as Stream +-- >>> import qualified Streamly.Data.Stream as Stream -- >>> import qualified Streamly.Data.Fold as Fold -- >>> import qualified Streamly.Internal.Unicode.Stream as Unicode -- >>> import Streamly.Internal.Unicode.Stream @@ -1066,7 +1066,7 @@ stripHead = Stream.dropWhile isSpace -- | Fold each line of the stream using the supplied 'Fold' -- and stream the result. -- --- >>> Stream.toList $ lines Fold.toList (Stream.fromList "lines\nthis\nstring\n\n\n") +-- >>> Stream.fold Fold.toList $ lines Fold.toList (Stream.fromList "lines\nthis\nstring\n\n\n") -- ["lines","this","string","",""] -- -- > lines = Stream.splitOnSuffix (== '\n') @@ -1097,7 +1097,7 @@ isSpace c -- | Fold each word of the stream using the supplied 'Fold' -- and stream the result. -- --- >>> Stream.toList $ words Fold.toList (Stream.fromList "fold these words") +-- >>> Stream.fold Fold.toList $ words Fold.toList (Stream.fromList "fold these words") -- ["fold","these","words"] -- -- > words = Stream.wordsBy isSpace diff --git a/docs/User/Tutorials/ConcurrentStreams.hs b/docs/User/Tutorials/ConcurrentStreams.hs index fc75e5a3..139df015 100644 --- a/docs/User/Tutorials/ConcurrentStreams.hs +++ b/docs/User/Tutorials/ConcurrentStreams.hs @@ -87,7 +87,7 @@ module User.Tutorials.ConcurrentStreams ) where -import Streamly.Prelude +import Streamly.Data.Stream import Data.Semigroup import Control.Applicative import Control.Monad @@ -96,8 +96,11 @@ import Control.Monad.Trans.Class (MonadTrans (lift)) -- CAUTION: please keep setup and imports sections in sync +-- XXX This tutorial has to be rewritten. + -- $setup -- >>> :m +-- >>> :set -fno-warn-deprecations -- >>> import Data.Function ((&)) -- >>> import Streamly.Prelude ((|:), (|&)) -- >>> import qualified Streamly.Prelude as Stream diff --git a/docs/User/Tutorials/ReactiveProgramming.hs b/docs/User/Tutorials/ReactiveProgramming.hs index ae4c054b..4fb2cb48 100644 --- a/docs/User/Tutorials/ReactiveProgramming.hs +++ b/docs/User/Tutorials/ReactiveProgramming.hs @@ -20,7 +20,7 @@ module User.Tutorials.ReactiveProgramming ) where -import Streamly.Prelude +import Streamly.Data.Stream import Data.Semigroup import Control.Applicative import Control.Monad diff --git a/docs/User/Tutorials/Tutorial.hs b/docs/User/Tutorials/Tutorial.hs index 2cf43242..f80b2bb9 100644 --- a/docs/User/Tutorials/Tutorial.hs +++ b/docs/User/Tutorials/Tutorial.hs @@ -74,7 +74,7 @@ module User.Tutorials.Tutorial ) where -import Streamly.Prelude +import Streamly.Data.Stream import Data.Semigroup import Control.Applicative import Control.Monad @@ -83,8 +83,11 @@ import Control.Monad.Trans.Class (MonadTrans (lift)) -- CAUTION: please keep setup and imports sections in sync +-- XXX This tutorial has to be re-written. + -- $setup -- >>> :m +-- >>> :set -fno-warn-deprecations -- >>> import Data.Function ((&)) -- >>> import Streamly.Prelude ((|:), (|&)) -- >>> import qualified Streamly.Prelude as Stream diff --git a/src/Streamly.hs b/src/Streamly.hs index 9bb33101..4b52aa1f 100644 --- a/src/Streamly.hs +++ b/src/Streamly.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly -- Copyright : (c) 2017 Composewell Technologies diff --git a/src/Streamly/Data/Array/Foreign.hs b/src/Streamly/Data/Array/Foreign.hs index e1288281..6b10f1ef 100644 --- a/src/Streamly/Data/Array/Foreign.hs +++ b/src/Streamly/Data/Array/Foreign.hs @@ -97,6 +97,7 @@ import Streamly.Internal.Data.Array.Unboxed as A -- $setup -- >>> :m +-- >>> :set -fno-warn-deprecations -- >>> :set -XFlexibleContexts -- >>> :set -package streamly -- >>> import Streamly.Internal.Data.Stream (Stream) diff --git a/src/Streamly/Internal/Data/Fold/Async.hs b/src/Streamly/Internal/Data/Fold/Async.hs index 36fe9787..876d0f2c 100644 --- a/src/Streamly/Internal/Data/Fold/Async.hs +++ b/src/Streamly/Internal/Data/Fold/Async.hs @@ -28,6 +28,7 @@ import Streamly.Internal.Data.Tuple.Strict (Tuple3'(..)) -- $setup -- >>> :m +-- >>> :set -fno-warn-deprecations -- >>> :set -XFlexibleContexts -- >>> import qualified Streamly.Prelude as Stream -- >>> import qualified Streamly.Data.Fold as Fold diff --git a/src/Streamly/Internal/Data/Stream/Ahead.hs b/src/Streamly/Internal/Data/Stream/Ahead.hs index d85607e1..1fe63e80 100644 --- a/src/Streamly/Internal/Data/Stream/Ahead.hs +++ b/src/Streamly/Internal/Data/Stream/Ahead.hs @@ -64,6 +64,7 @@ import Prelude hiding (map) #include "Instances.hs" -- $setup +-- >>> :set -fno-warn-deprecations -- >>> import qualified Streamly.Prelude as Stream -- >>> import Control.Concurrent (threadDelay) -- >>> :{ diff --git a/src/Streamly/Internal/Data/Stream/Async.hs b/src/Streamly/Internal/Data/Stream/Async.hs index b4e68ac0..8f083c25 100644 --- a/src/Streamly/Internal/Data/Stream/Async.hs +++ b/src/Streamly/Internal/Data/Stream/Async.hs @@ -73,6 +73,7 @@ import Streamly.Internal.Data.SVar #include "Instances.hs" -- $setup +-- >>> :set -fno-warn-deprecations -- >>> import qualified Streamly.Prelude as Stream -- >>> import Control.Concurrent (threadDelay) -- >>> :{ diff --git a/src/Streamly/Internal/Data/Stream/IsStream.hs b/src/Streamly/Internal/Data/Stream/IsStream.hs index 042c1090..cf7d9253 100644 --- a/src/Streamly/Internal/Data/Stream/IsStream.hs +++ b/src/Streamly/Internal/Data/Stream/IsStream.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Internal.Data.Stream.IsStream -- Copyright : (c) 2017 Composewell Technologies @@ -10,7 +12,7 @@ -- module "Streamly.Prelude". It contains some additional unreleased or -- experimental APIs. -module Streamly.Internal.Data.Stream.IsStream +module Streamly.Internal.Data.Stream.IsStream {-# DEPRECATED "Please use \"Streamly.Data.Stream\", \"Streamly.Data.Stream.Concurrent\", & \"Streamly.Data.Stream.Time\" instead." #-} ( module Streamly.Internal.Data.Stream.IsStream.Type , module Streamly.Internal.Data.Stream.IsStream.Generate , module Streamly.Internal.Data.Stream.IsStream.Eliminate diff --git a/src/Streamly/Internal/Data/Stream/IsStream/Combinators.hs b/src/Streamly/Internal/Data/Stream/IsStream/Combinators.hs index fa93aac4..bf5730a9 100644 --- a/src/Streamly/Internal/Data/Stream/IsStream/Combinators.hs +++ b/src/Streamly/Internal/Data/Stream/IsStream/Combinators.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Internal.Data.Stream.Combinators -- Copyright : (c) 2017 Composewell Technologies @@ -7,7 +9,7 @@ -- Portability : GHC -- -- -module Streamly.Internal.Data.Stream.IsStream.Combinators +module Streamly.Internal.Data.Stream.IsStream.Combinators {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-} ( maxThreads , maxBuffer , maxYields diff --git a/src/Streamly/Internal/Data/Stream/IsStream/Common.hs b/src/Streamly/Internal/Data/Stream/IsStream/Common.hs index a1ff1b31..d07d336d 100644 --- a/src/Streamly/Internal/Data/Stream/IsStream/Common.hs +++ b/src/Streamly/Internal/Data/Stream/IsStream/Common.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} {-# OPTIONS_GHC -Wno-orphans #-} -- | @@ -11,7 +12,7 @@ -- Bottom level IsStream module that can be used by all other upper level -- IsStream modules. -module Streamly.Internal.Data.Stream.IsStream.Common +module Streamly.Internal.Data.Stream.IsStream.Common {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-} ( -- * Generation fromPure @@ -98,6 +99,7 @@ import Prelude hiding (take, takeWhile, drop, reverse, concatMap, map, zipWith) -- -- $setup -- >>> :m +-- >>> :set -fno-warn-deprecations -- >>> import Control.Concurrent (threadDelay) -- >>> import Control.Monad (join) -- >>> import Control.Monad.Trans.Class (lift) diff --git a/src/Streamly/Internal/Data/Stream/IsStream/Eliminate.hs b/src/Streamly/Internal/Data/Stream/IsStream/Eliminate.hs index 57cf0900..df259020 100644 --- a/src/Streamly/Internal/Data/Stream/IsStream/Eliminate.hs +++ b/src/Streamly/Internal/Data/Stream/IsStream/Eliminate.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Internal.Data.Stream.IsStream.Eliminate -- Copyright : (c) 2017 Composewell Technologies @@ -15,7 +17,7 @@ -- We call them stream folding functions, they reduce a stream @t m a@ to a -- monadic value @m b@. -module Streamly.Internal.Data.Stream.IsStream.Eliminate +module Streamly.Internal.Data.Stream.IsStream.Eliminate {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-} ( -- * Running Examples -- $setup @@ -188,6 +190,7 @@ import Prelude hiding -- $setup -- >>> :m +-- >>> :set -fno-warn-deprecations -- >>> import Streamly.Prelude (SerialT) -- >>> import qualified Streamly.Prelude as Stream -- >>> import qualified Streamly.Internal.Data.Stream.IsStream as Stream diff --git a/src/Streamly/Internal/Data/Stream/IsStream/Enumeration.hs b/src/Streamly/Internal/Data/Stream/IsStream/Enumeration.hs index 54d058a1..3251e1d3 100644 --- a/src/Streamly/Internal/Data/Stream/IsStream/Enumeration.hs +++ b/src/Streamly/Internal/Data/Stream/IsStream/Enumeration.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Internal.Data.Stream.Enumeration -- Copyright : (c) 2018 Composewell Technologies @@ -20,7 +22,7 @@ -- in this module can be used to define them. Alternatively, these functions -- can be used directly. -module Streamly.Internal.Data.Stream.IsStream.Enumeration +module Streamly.Internal.Data.Stream.IsStream.Enumeration {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-} ( Enumerable (..) @@ -77,6 +79,7 @@ import qualified Streamly.Internal.Data.Stream.StreamD as D import qualified Streamly.Internal.Data.Stream.Serial as Serial (map) -- $setup +-- >>> :set -fno-warn-deprecations -- >>> import Streamly.Prelude as Stream -- >>> import Streamly.Internal.Data.Stream.IsStream.Enumeration as Stream diff --git a/src/Streamly/Internal/Data/Stream/IsStream/Exception.hs b/src/Streamly/Internal/Data/Stream/IsStream/Exception.hs index 386decbc..a40c01be 100644 --- a/src/Streamly/Internal/Data/Stream/IsStream/Exception.hs +++ b/src/Streamly/Internal/Data/Stream/IsStream/Exception.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Internal.Data.Stream.IsStream.Exception -- Copyright : (c) 2019 Composewell Technologies @@ -6,7 +8,7 @@ -- Stability : experimental -- Portability : GHC -module Streamly.Internal.Data.Stream.IsStream.Exception +module Streamly.Internal.Data.Stream.IsStream.Exception {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-} ( before , after_ @@ -46,6 +48,7 @@ import qualified Streamly.Internal.Data.Stream.StreamD.Exception as D -- $setup -- >>> :m +-- >>> :set -fno-warn-deprecations -- >>> import qualified Streamly.Prelude as Stream -- >>> import qualified Streamly.Internal.Data.Stream.IsStream as Stream (nilM) diff --git a/src/Streamly/Internal/Data/Stream/IsStream/Expand.hs b/src/Streamly/Internal/Data/Stream/IsStream/Expand.hs index 3da2a621..e7743416 100644 --- a/src/Streamly/Internal/Data/Stream/IsStream/Expand.hs +++ b/src/Streamly/Internal/Data/Stream/IsStream/Expand.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Internal.Data.Stream.IsStream.Expand -- Copyright : (c) 2017 Composewell Technologies @@ -9,7 +11,7 @@ -- Expand a stream by combining two or more streams or by combining streams -- with unfolds. -module Streamly.Internal.Data.Stream.IsStream.Expand +module Streamly.Internal.Data.Stream.IsStream.Expand {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-} ( -- * Binary Combinators (Linear) -- | Functions ending in the shape: @@ -190,6 +192,7 @@ import Prelude hiding (concat, concatMap, zipWith) -- $setup -- >>> :m +-- >>> :set -fno-warn-deprecations -- >>> import Control.Concurrent (threadDelay) -- >>> import Data.IORef -- >>> import Prelude hiding (zipWith, concatMap, concat) diff --git a/src/Streamly/Internal/Data/Stream/IsStream/Generate.hs b/src/Streamly/Internal/Data/Stream/IsStream/Generate.hs index 15be0ffd..2235d6ba 100644 --- a/src/Streamly/Internal/Data/Stream/IsStream/Generate.hs +++ b/src/Streamly/Internal/Data/Stream/IsStream/Generate.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} {-# OPTIONS_GHC -Wno-orphans #-} -- | @@ -15,7 +16,7 @@ -- as StreamK when StreamK is used, avoiding conversion to StreamD. Will that -- help? Are there any other reasons to keep these and not use unfolds? -module Streamly.Internal.Data.Stream.IsStream.Generate +module Streamly.Internal.Data.Stream.IsStream.Generate {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-} ( -- * Primitives IsStream.nil @@ -124,6 +125,7 @@ import Prelude hiding (iterate, replicate, repeat) -- $setup -- >>> :m +-- >>> :set -fno-warn-deprecations -- >>> import Data.Function ((&)) -- >>> import Prelude hiding (iterate, replicate, repeat) -- >>> import qualified Streamly.Prelude as Stream diff --git a/src/Streamly/Internal/Data/Stream/IsStream/Lift.hs b/src/Streamly/Internal/Data/Stream/IsStream/Lift.hs index 57e52e1b..a10f46ef 100644 --- a/src/Streamly/Internal/Data/Stream/IsStream/Lift.hs +++ b/src/Streamly/Internal/Data/Stream/IsStream/Lift.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Internal.Data.Stream.IsStream.Lift -- Copyright : (c) 2019 Composewell Technologies @@ -6,7 +8,7 @@ -- Stability : experimental -- Portability : GHC -module Streamly.Internal.Data.Stream.IsStream.Lift +module Streamly.Internal.Data.Stream.IsStream.Lift {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-} ( -- * Generalize Inner Monad hoist diff --git a/src/Streamly/Internal/Data/Stream/IsStream/Reduce.hs b/src/Streamly/Internal/Data/Stream/IsStream/Reduce.hs index d89870ab..5b7c0381 100644 --- a/src/Streamly/Internal/Data/Stream/IsStream/Reduce.hs +++ b/src/Streamly/Internal/Data/Stream/IsStream/Reduce.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Internal.Data.Stream.IsStream.Reduce -- Copyright : (c) 2017 Composewell Technologies @@ -8,7 +10,7 @@ -- -- Reduce streams by streams, folds or parsers. -module Streamly.Internal.Data.Stream.IsStream.Reduce +module Streamly.Internal.Data.Stream.IsStream.Reduce {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-} ( -- * Reduce By Streams dropPrefix @@ -211,6 +213,7 @@ import Prelude hiding (concatMap, map) -- $setup -- >>> :m +-- >>> :set -fno-warn-deprecations -- >>> import Prelude hiding (zipWith, concatMap, concat) -- >>> import qualified Streamly.Prelude as Stream -- >>> import Streamly.Internal.Data.Stream.IsStream as Stream diff --git a/src/Streamly/Internal/Data/Stream/IsStream/Top.hs b/src/Streamly/Internal/Data/Stream/IsStream/Top.hs index 47ce5bd4..672e60c2 100644 --- a/src/Streamly/Internal/Data/Stream/IsStream/Top.hs +++ b/src/Streamly/Internal/Data/Stream/IsStream/Top.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Internal.Data.Stream.IsStream.Top -- Copyright : (c) 2020 Composewell Technologies @@ -9,7 +11,7 @@ -- Top level IsStream module that can use all other lower level IsStream -- modules. -module Streamly.Internal.Data.Stream.IsStream.Top +module Streamly.Internal.Data.Stream.IsStream.Top {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-} ( -- * Transformation -- ** Sampling @@ -87,6 +89,7 @@ import Prelude hiding (filter, zipWith, concatMap, concat) -- $setup -- >>> :m +-- >>> :set -fno-warn-deprecations -- >>> import Prelude hiding (filter, zipWith, concatMap, concat) -- >>> import qualified Streamly.Prelude as Stream -- >>> import qualified Streamly.Internal.Data.Stream.IsStream as Stream diff --git a/src/Streamly/Internal/Data/Stream/IsStream/Transform.hs b/src/Streamly/Internal/Data/Stream/IsStream/Transform.hs index 04d1fa6f..d30b3ca5 100644 --- a/src/Streamly/Internal/Data/Stream/IsStream/Transform.hs +++ b/src/Streamly/Internal/Data/Stream/IsStream/Transform.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Internal.Data.Stream.IsStream.Transform -- Copyright : (c) 2017 Composewell Technologies @@ -6,7 +8,7 @@ -- Stability : experimental -- Portability : GHC -module Streamly.Internal.Data.Stream.IsStream.Transform +module Streamly.Internal.Data.Stream.IsStream.Transform {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-} ( -- * Piping -- | Pass through a 'Pipe'. @@ -272,6 +274,7 @@ import Prelude hiding -- -- $setup -- >>> :m +-- >>> :set -fno-warn-deprecations -- >>> import Control.Concurrent (threadDelay) -- >>> import Data.Function ((&)) -- >>> import Streamly.Prelude ((|$)) diff --git a/src/Streamly/Internal/Data/Stream/IsStream/Type.hs b/src/Streamly/Internal/Data/Stream/IsStream/Type.hs index 075d5803..1a6fea86 100644 --- a/src/Streamly/Internal/Data/Stream/IsStream/Type.hs +++ b/src/Streamly/Internal/Data/Stream/IsStream/Type.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -10,7 +11,7 @@ -- Portability : GHC -- -- -module Streamly.Internal.Data.Stream.IsStream.Type +module Streamly.Internal.Data.Stream.IsStream.Type {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-} ( -- * IsStream Type Class IsStream (..) diff --git a/src/Streamly/Internal/Data/Stream/Serial.hs b/src/Streamly/Internal/Data/Stream/Serial.hs index 2ccdcd2a..6588a3aa 100644 --- a/src/Streamly/Internal/Data/Stream/Serial.hs +++ b/src/Streamly/Internal/Data/Stream/Serial.hs @@ -79,6 +79,7 @@ import Prelude hiding (map, mapM, repeat, filter) #include "inline.hs" -- $setup +-- >>> :set -fno-warn-deprecations -- >>> import qualified Streamly.Data.Stream as Stream -- >>> import qualified Streamly.Prelude as IsStream diff --git a/src/Streamly/Internal/Data/Stream/Zip/Concurrent.hs b/src/Streamly/Internal/Data/Stream/Zip/Concurrent.hs index 77ff4f93..84c3e1a6 100644 --- a/src/Streamly/Internal/Data/Stream/Zip/Concurrent.hs +++ b/src/Streamly/Internal/Data/Stream/Zip/Concurrent.hs @@ -9,7 +9,8 @@ -- -- To run examples in this module: -- --- >>> import qualified Streamly.Prelude as Stream +-- >>> import qualified Streamly.Internal.Data.Stream as Stream +-- >>> import qualified Streamly.Data.Fold as Fold -- module Streamly.Internal.Data.Stream.Zip.Concurrent ( diff --git a/src/Streamly/Internal/Data/Stream/ZipAsync.hs b/src/Streamly/Internal/Data/Stream/ZipAsync.hs index edd6bdb0..13f54561 100644 --- a/src/Streamly/Internal/Data/Stream/ZipAsync.hs +++ b/src/Streamly/Internal/Data/Stream/ZipAsync.hs @@ -39,6 +39,7 @@ import Prelude hiding (map, repeat, zipWith, errorWithoutStackTrace) #include "Instances.hs" -- $setup +-- >>> :set -fno-warn-deprecations -- >>> import qualified Streamly.Prelude as Stream -- >>> import Control.Concurrent (threadDelay) -- >>> :{ diff --git a/src/Streamly/Internal/Network/Inet/TCP.hs b/src/Streamly/Internal/Network/Inet/TCP.hs index e4955887..52dd3ba4 100644 --- a/src/Streamly/Internal/Network/Inet/TCP.hs +++ b/src/Streamly/Internal/Network/Inet/TCP.hs @@ -124,7 +124,7 @@ import qualified Streamly.Internal.Data.Unfold as UF (bracket, first) import qualified Streamly.Internal.Data.Array.Unboxed.Stream as AS import qualified Streamly.Internal.Data.Fold.Type as FL (initialize, snoc, Step(..)) -import qualified Streamly.Internal.Data.Stream.IsStream as S +import qualified Streamly.Internal.Data.Stream as S import qualified Streamly.Internal.Network.Socket as ISK ------------------------------------------------------------------------------- @@ -346,7 +346,8 @@ putChunks -> Stream m (Array Word8) -> m () putChunks addr port xs = - S.drain $ withConnection addr port (\sk -> S.fromEffect $ ISK.putChunks sk xs) + S.fold FL.drain + $ withConnection addr port (\sk -> S.fromEffect $ ISK.putChunks sk xs) -- | Write a stream of arrays to the supplied IPv4 host address and port -- number. diff --git a/src/Streamly/Internal/Unicode/Char.hs b/src/Streamly/Internal/Unicode/Char.hs index ac68795f..c20b3856 100644 --- a/src/Streamly/Internal/Unicode/Char.hs +++ b/src/Streamly/Internal/Unicode/Char.hs @@ -30,10 +30,11 @@ where import Data.Char (isAsciiUpper, isAsciiLower, chr, ord) import Unicode.Char (DecomposeMode(..)) -import Streamly.Internal.Data.Stream.IsStream.Type - (IsStream, fromStreamD, toStreamD) +import Streamly.Internal.Data.Stream (fromStreamD, toStreamD) import Streamly.Internal.Data.Stream.StreamD (Stream(..), Step (..)) +import qualified Streamly.Internal.Data.Stream as Stream (Stream) + import qualified Unicode.Char as Char ------------------------------------------------------------------------------- @@ -313,5 +314,9 @@ normalizeD NFKD = decomposeD True Kompat normalizeD NFC = partialComposeD . decomposeD False Canonical normalizeD NFKC = partialComposeD . decomposeD False Kompat -normalize :: (IsStream t, Monad m) => NormalizationMode -> t m Char -> t m Char +normalize :: + Monad m + => NormalizationMode + -> Stream.Stream m Char + -> Stream.Stream m Char normalize mode = fromStreamD . normalizeD mode . toStreamD diff --git a/src/Streamly/Internal/Unicode/Utf8.hs b/src/Streamly/Internal/Unicode/Utf8.hs index b29cee58..845868fa 100644 --- a/src/Streamly/Internal/Unicode/Utf8.hs +++ b/src/Streamly/Internal/Unicode/Utf8.hs @@ -27,9 +27,12 @@ import Data.Word (Word8) import Streamly.Data.Array.Unboxed (Array) import System.IO.Unsafe (unsafePerformIO) -import qualified Streamly.Internal.Data.Array.Unboxed as Array - (fromStreamN, read) -import qualified Streamly.Internal.Data.Stream.IsStream as Stream +import qualified Streamly.Data.Fold as Fold +import qualified Streamly.Data.Stream as Stream +import qualified Streamly.Internal.Data.Array.Unboxed as Array + ( fromStreamN + , read + ) import qualified Streamly.Internal.Unicode.Stream as Unicode -------------------------------------------------------------------------------- @@ -65,4 +68,4 @@ pack s = unpack :: Utf8 -> String unpack u = unsafePerformIO - $ Stream.toList $ Unicode.decodeUtf8' $ Array.read $ toArray u + $ Stream.fold Fold.toList $ Unicode.decodeUtf8' $ Array.read $ toArray u diff --git a/src/Streamly/Prelude.hs b/src/Streamly/Prelude.hs index 3291622e..c121ba4d 100644 --- a/src/Streamly/Prelude.hs +++ b/src/Streamly/Prelude.hs @@ -1,3 +1,4 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} {-# OPTIONS_GHC -Wno-orphans #-} #include "inline.hs" @@ -317,7 +318,7 @@ -- documentation for illustration. The actual implementation may differ for -- performance reasons. -module Streamly.Prelude +module Streamly.Prelude {-# DEPRECATED "Please use \"Streamly.Data.Stream\", \"Streamly.Data.Stream.Concurrent\", & \"Streamly.Data.Stream.Time\" instead." #-} ( -- * Construction -- | Functions ending in the general shape @b -> t m a@. @@ -945,6 +946,7 @@ import Prelude import Streamly.Internal.Data.Stream.IsStream -- $setup +-- >>> :set -fno-warn-deprecations -- >>> import qualified Streamly.Data.Fold as Fold -- >>> import qualified Streamly.Prelude as Stream diff --git a/test/Streamly/Test/Data/Array.hs b/test/Streamly/Test/Data/Array.hs index 98184bfd..946a8499 100644 --- a/test/Streamly/Test/Data/Array.hs +++ b/test/Streamly/Test/Data/Array.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Test.Data.Array -- Copyright : (c) 2019 Composewell Technologies diff --git a/test/Streamly/Test/Data/Array/Stream/Unboxed.hs b/test/Streamly/Test/Data/Array/Stream/Unboxed.hs index e1b2ecae..a29de82a 100644 --- a/test/Streamly/Test/Data/Array/Stream/Unboxed.hs +++ b/test/Streamly/Test/Data/Array/Stream/Unboxed.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + module Main (main) where import Data.Word (Word8) diff --git a/test/Streamly/Test/Data/SmallArray.hs b/test/Streamly/Test/Data/SmallArray.hs index 378bdcc0..3f4e8f83 100644 --- a/test/Streamly/Test/Data/SmallArray.hs +++ b/test/Streamly/Test/Data/SmallArray.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Test.Data.SmallArray -- Copyright : (c) 2020 Composewell technologies diff --git a/test/Streamly/Test/FileSystem/Event/Common.hs b/test/Streamly/Test/FileSystem/Event/Common.hs index 28b502a4..f8bb2c84 100644 --- a/test/Streamly/Test/FileSystem/Event/Common.hs +++ b/test/Streamly/Test/FileSystem/Event/Common.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Test.FileSystem.Event.Common -- Copyright : (c) 2020 Composewell Technologies diff --git a/test/Streamly/Test/Network/Inet/TCP.hs b/test/Streamly/Test/Network/Inet/TCP.hs index a907f2bd..fc3d7eef 100644 --- a/test/Streamly/Test/Network/Inet/TCP.hs +++ b/test/Streamly/Test/Network/Inet/TCP.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Test.Network.Socket -- Copyright : (c) 2020 Composewell technologies diff --git a/test/Streamly/Test/Network/Socket.hs b/test/Streamly/Test/Network/Socket.hs index 0cfca360..96ca2f5f 100644 --- a/test/Streamly/Test/Network/Socket.hs +++ b/test/Streamly/Test/Network/Socket.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Test.Network.Socket -- Copyright : (c) 2020 Composewell technologies diff --git a/test/Streamly/Test/Prelude.hs b/test/Streamly/Test/Prelude.hs index 55bbbe66..c8f0587a 100644 --- a/test/Streamly/Test/Prelude.hs +++ b/test/Streamly/Test/Prelude.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Test.Prelude -- Copyright : (c) 2020 Composewell Technologies diff --git a/test/Streamly/Test/Prelude/Ahead.hs b/test/Streamly/Test/Prelude/Ahead.hs index 6d0f08d1..13e27dc3 100644 --- a/test/Streamly/Test/Prelude/Ahead.hs +++ b/test/Streamly/Test/Prelude/Ahead.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Test.Prelude.Ahead -- Copyright : (c) 2020 Composewell Technologies diff --git a/test/Streamly/Test/Prelude/Async.hs b/test/Streamly/Test/Prelude/Async.hs index 0de8d6fd..e0715173 100644 --- a/test/Streamly/Test/Prelude/Async.hs +++ b/test/Streamly/Test/Prelude/Async.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Test.Prelude.Async -- Copyright : (c) 2020 Composewell Technologies diff --git a/test/Streamly/Test/Prelude/Concurrent.hs b/test/Streamly/Test/Prelude/Concurrent.hs index 8b239362..63b88038 100644 --- a/test/Streamly/Test/Prelude/Concurrent.hs +++ b/test/Streamly/Test/Prelude/Concurrent.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Test.Prelude.Concurrent -- Copyright : (c) 2020 Composewell Technologies diff --git a/test/Streamly/Test/Prelude/Fold.hs b/test/Streamly/Test/Prelude/Fold.hs index 68b1195f..768e37ba 100644 --- a/test/Streamly/Test/Prelude/Fold.hs +++ b/test/Streamly/Test/Prelude/Fold.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Test.Prelude.Fold -- Copyright : (c) 2020 Composewell Technologies diff --git a/test/Streamly/Test/Prelude/Parallel.hs b/test/Streamly/Test/Prelude/Parallel.hs index 704014b5..513c8119 100644 --- a/test/Streamly/Test/Prelude/Parallel.hs +++ b/test/Streamly/Test/Prelude/Parallel.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Test.Prelude.Parallel -- Copyright : (c) 2020 Composewell Technologies diff --git a/test/Streamly/Test/Prelude/Rate.hs b/test/Streamly/Test/Prelude/Rate.hs index b09d16ff..11c348a4 100644 --- a/test/Streamly/Test/Prelude/Rate.hs +++ b/test/Streamly/Test/Prelude/Rate.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Test.Prelude.MaxRate -- Copyright : (c) 2018 Composewell Technologies diff --git a/test/Streamly/Test/Prelude/Serial.hs b/test/Streamly/Test/Prelude/Serial.hs index 4a16d5e2..6980b5c5 100644 --- a/test/Streamly/Test/Prelude/Serial.hs +++ b/test/Streamly/Test/Prelude/Serial.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Test.Prelude.Serial -- Copyright : (c) 2020 Composewell Technologies diff --git a/test/Streamly/Test/Prelude/Top.hs b/test/Streamly/Test/Prelude/Top.hs index 6527355b..b7949863 100644 --- a/test/Streamly/Test/Prelude/Top.hs +++ b/test/Streamly/Test/Prelude/Top.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + module Main (main) where import Data.List (elem, intersect, nub, sort) diff --git a/test/Streamly/Test/Prelude/WAsync.hs b/test/Streamly/Test/Prelude/WAsync.hs index 859626d7..9e616c64 100644 --- a/test/Streamly/Test/Prelude/WAsync.hs +++ b/test/Streamly/Test/Prelude/WAsync.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Test.Prelude.WAsync -- Copyright : (c) 2020 Composewell Technologies diff --git a/test/Streamly/Test/Prelude/WSerial.hs b/test/Streamly/Test/Prelude/WSerial.hs index 184d5053..662d0d1f 100644 --- a/test/Streamly/Test/Prelude/WSerial.hs +++ b/test/Streamly/Test/Prelude/WSerial.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Test.Prelude.WSerial -- Copyright : (c) 2020 Composewell Technologies diff --git a/test/Streamly/Test/Prelude/ZipAsync.hs b/test/Streamly/Test/Prelude/ZipAsync.hs index 954b7e3c..20f4900d 100644 --- a/test/Streamly/Test/Prelude/ZipAsync.hs +++ b/test/Streamly/Test/Prelude/ZipAsync.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Test.Prelude.ZipAsync -- Copyright : (c) 2020 Composewell Technologies diff --git a/test/Streamly/Test/Prelude/ZipSerial.hs b/test/Streamly/Test/Prelude/ZipSerial.hs index 57a86864..fee60fa0 100644 --- a/test/Streamly/Test/Prelude/ZipSerial.hs +++ b/test/Streamly/Test/Prelude/ZipSerial.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Test.Prelude.ZipSerial -- Copyright : (c) 2020 Composewell Technologies diff --git a/test/Streamly/Test/Unicode/Stream.hs b/test/Streamly/Test/Unicode/Stream.hs index 149990bd..4c0c641a 100644 --- a/test/Streamly/Test/Unicode/Stream.hs +++ b/test/Streamly/Test/Unicode/Stream.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + module Streamly.Test.Unicode.Stream (main) where import Data.Char (ord, chr) diff --git a/test/lib/Streamly/Test/Prelude/Common.hs b/test/lib/Streamly/Test/Prelude/Common.hs index 0ae05181..cc2b6af4 100644 --- a/test/lib/Streamly/Test/Prelude/Common.hs +++ b/test/lib/Streamly/Test/Prelude/Common.hs @@ -1,3 +1,5 @@ +{-# OPTIONS_GHC -Wno-deprecations #-} + -- | -- Module : Streamly.Test.Prelude.Common -- Copyright : (c) 2020 Composewell Technologies