From a89599f35e72b88857773c035553bcf9974d9d3f Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Mon, 24 Oct 2022 11:53:42 -0400 Subject: [PATCH] Reorder E.A.R.reduce arguments --- .../src/rescript/Distributions/PointSetDist/Continuous.res | 2 +- .../src/rescript/Distributions/PointSetDist/Discrete.res | 2 +- packages/squiggle-lang/src/rescript/Utility/E/E_A.res | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Continuous.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Continuous.res index 6a5df88a09..38bf1c4ede 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Continuous.res +++ b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Continuous.res @@ -156,7 +156,7 @@ let reduce = ( fn: (float, float) => result, ): result => { let merge = combinePointwise(~integralSumCachesFn, fn) - continuousShapes->E.A.R.foldM(merge, empty, _) + continuousShapes->E.A.R.foldM(empty, merge) } let mapYResult = ( diff --git a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res index 612da05643..baab7f0f60 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res +++ b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res @@ -58,7 +58,7 @@ let reduce = ( fn: (float, float) => result, ): result => { let merge = combinePointwise(~integralSumCachesFn, ~fn) - discreteShapes->E.A.R.foldM(merge, empty, _) + discreteShapes->E.A.R.foldM(empty, merge) } let updateIntegralSumCache = (t: t, integralSumCache): t => { diff --git a/packages/squiggle-lang/src/rescript/Utility/E/E_A.res b/packages/squiggle-lang/src/rescript/Utility/E/E_A.res index 7f0a04ea25..5e74ceb177 100644 --- a/packages/squiggle-lang/src/rescript/Utility/E/E_A.res +++ b/packages/squiggle-lang/src/rescript/Utility/E/E_A.res @@ -143,7 +143,7 @@ module R = { let forM = (x: array<'a>, fn: 'a => result<'b, 'c>): result, 'c> => firstErrorOrOpen(fmap(x, fn)) - let foldM = (fn: ('c, 'a) => result<'b, 'e>, init: 'c, x: array<'a>): result<'c, 'e> => { + let foldM = (x: array<'a>, init: 'c, fn: ('c, 'a) => result<'b, 'e>): result<'c, 'e> => { let acc = ref(init) let final = ref(Ok()) let break = ref(false)