Skip to content

Commit

Permalink
Make follow up changes for flipping the argument order of Replace
Browse files Browse the repository at this point in the history
  • Loading branch information
adithyaov committed Dec 15, 2024
1 parent 2f4af91 commit 9ea5c04
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions cabal.project.Werror
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ packages: streamly-statistics.cabal
source-repository-package
type: git
location: https://github.com/composewell/streamly.git
tag: master
tag: 3f46653cb06605bff25cc8fc81dc7ed732ef31b5

source-repository-package
type: git
location: https://github.com/composewell/streamly.git
tag: master
tag: 3f46653cb06605bff25cc8fc81dc7ed732ef31b5
subdir: core

jobs: 1
Expand Down
4 changes: 2 additions & 2 deletions cabal.project.user
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ packages: streamly-statistics.cabal
source-repository-package
type: git
location: https://github.com/composewell/streamly.git
tag: master
tag: 3f46653cb06605bff25cc8fc81dc7ed732ef31b5

source-repository-package
type: git
location: https://github.com/composewell/streamly.git
tag: master
tag: 3f46653cb06605bff25cc8fc81dc7ed732ef31b5
subdir: core

jobs: 1
10 changes: 5 additions & 5 deletions src/Streamly/Statistics/Scanl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ incrMinimum = Scanl step initial extract extract
(w + 1)
(headCheck i q (w + 1) & dqloop (i, a))

step (Tuple3' i w q) (Replace new _) =
step (Tuple3' i w q) (Replace1 _ new) =
return
$ Partial
$ Tuple3' (i + 1) w (headCheck i q w & dqloop (i, new))
Expand Down Expand Up @@ -216,7 +216,7 @@ incrMaximum = Scanl step initial extract extract
(w + 1)
(headCheck i q (w + 1) & dqloop (i, a))

step (Tuple3' i w q) (Replace new _) =
step (Tuple3' i w q) (Replace1 _ new) =
return
$ Partial
$ Tuple3' (i + 1) w (headCheck i q w & dqloop (i, new))
Expand Down Expand Up @@ -296,7 +296,7 @@ incrWelfordMean = Scanl step initial extract extract
step (Tuple' oldMean w) (Insert new) =
return $ Partial $ Tuple' (meanAdd w oldMean new) (w + 1)

step (Tuple' oldMean w) (Replace new old) =
step (Tuple' oldMean w) (Replace1 old new) =
return $ Partial $ Tuple' (meanReplace w oldMean old new) w

extract (Tuple' x _) = return x
Expand Down Expand Up @@ -531,7 +531,7 @@ incrEwma w = Scanl step initial extract extract
let s1 = w * x + (1 - w) * s
return $ Partial (EwmaGo s1 (k * (1 - w)))

step (EwmaGo s k) (Replace x x0, rng) = do
step (EwmaGo s k) (Replace1 x0 x, rng) = do
x1 <- Ring.unsafeGetIndex 0 rng
let s1 = w * x + (1 - w) * s + k * (x1 - x0)
return $ Partial (EwmaGo s1 k)
Expand Down Expand Up @@ -782,6 +782,6 @@ incrFrequency = Scanl.mkScanl step Map.empty
step refCountMap (Insert new) =
Map.insertWith (+) new 1 refCountMap

step refCountMap (Replace new old) =
step refCountMap (Replace1 old new) =
let m1 = Map.insertWith (+) new 1 refCountMap
in Map.update decrement old m1
4 changes: 2 additions & 2 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ packages:

extra-deps:
- github: composewell/streamly
commit: "3fc854472d4f0582ea0451e216ddc9f054908e62"
commit: "3f46653cb06605bff25cc8fc81dc7ed732ef31b5"
- github: composewell/streamly
commit: "3fc854472d4f0582ea0451e216ddc9f054908e62"
commit: "3f46653cb06605bff25cc8fc81dc7ed732ef31b5"
subdirs:
- core

Expand Down

0 comments on commit 9ea5c04

Please sign in to comment.