on master help sign in
Deprecate variance and stdDev in folds
commit0d2ce6ca76493f879481bd1e9ad228999d4bbb3a authorAdithya Kumar <adithya@composewell.com> dateSun 5 Jun 2022, 02:45 (4 years ago) parentf81f8b5
5 files changed+16−4
benchmark/Streamly/Benchmark/Data/Fold.hs+1 core/src/Streamly/Data/Fold.hs+2−2 core/src/Streamly/Internal/Data/Fold.hs+4−2 docs/User/ProjectRelated/Changelog.md+7 test/Streamly/Test/Data/Fold.hs+2
benchmark/Streamly/Benchmark/Data/Fold.hs+1
@@ -8,6 +8,7 @@
88{-# LANGUAGE FlexibleContexts #-}
99{-# LANGUAGE RankNTypes #-}
1010{-# LANGUAGE ScopedTypeVariables #-}
11+{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}
1112
1213module Main (main) where
1314
core/src/Streamly/Data/Fold.hs+2−2
@@ -162,8 +162,6 @@ module Streamly.Data.Fold
162162 , minimumBy
163163 , minimum
164164 , mean
165− , variance
166− , stdDev
167165 , rollingHash
168166 , rollingHashWithSalt
169167
@@ -270,6 +268,8 @@ module Streamly.Data.Fold
270268 -- * Deprecated
271269 , sequence
272270 , mapM
271+ , variance
272+ , stdDev
273273 )
274274where
275275
core/src/Streamly/Internal/Data/Fold.hs+4−2
@@ -57,8 +57,6 @@ module Streamly.Internal.Data.Fold
5757 , countDistinct
5858 , countDistinctInt
5959 , mean
60− , variance
61− , stdDev
6260 , rollingHash
6361 , rollingHashWithSalt
6462 , rollingHashFirstN
@@ -285,6 +283,8 @@ module Streamly.Internal.Data.Fold
285283 -- * Deprecated
286284 , sequence
287285 , mapM
286+ , variance
287+ , stdDev
288288 )
289289where
290290
@@ -794,6 +794,7 @@ mean = fmap done $ foldl' step begin
794794-- the input stream.
795795--
796796-- @since 0.7.0
797+{-# DEPRECATED variance "Use the streamly-statistics package instead" #-}
797798{-# INLINE variance #-}
798799variance :: (Monad m, Fractional a) => Fold m a a
799800variance = fmap done $ foldl' step begin
@@ -817,6 +818,7 @@ variance = fmap done $ foldl' step begin
817818-- elements in the input stream.
818819--
819820-- @since 0.7.0
821+{-# DEPRECATED stdDev "Use the streamly-statistics package instead" #-}
820822{-# INLINE stdDev #-}
821823stdDev :: (Monad m, Floating a) => Fold m a a
822824stdDev = sqrt <$> variance
docs/User/ProjectRelated/Changelog.md+7
@@ -8,6 +8,13 @@
88 readChunksWithBufferOf -> readChunksWith
99 writeWithBufferOf -> writeWith
1010 writeChunksWithBufferOf -> writeChunksWith
11+
12+### Deprecations
13+
14+* In `Streamly.Data.Fold`:
15+ * `variance`, and `stdDev` have been deprecated. Please use the
16+ `streamly-statistics` package instead.
17+
1118## 0.8.2 (Mar 2022)
1219
1320* Fix performance issues for GHC-9. These changes coupled with GHC changes
test/Streamly/Test/Data/Fold.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -fno-warn-warnings-deprecations #-}
2+
13module Main (main) where
24
35import Data.List (sort)