Skip to content

Commit

Permalink
Reorder E.A.R.reduce arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
mlochbaum committed Oct 24, 2022
1 parent 7e360b2 commit a89599f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ let reduce = (
fn: (float, float) => result<float, 'e>,
): result<t, 'e> => {
let merge = combinePointwise(~integralSumCachesFn, fn)
continuousShapes->E.A.R.foldM(merge, empty, _)
continuousShapes->E.A.R.foldM(empty, merge)
}

let mapYResult = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ let reduce = (
fn: (float, float) => result<float, 'e>,
): result<t, 'e> => {
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 => {
Expand Down
2 changes: 1 addition & 1 deletion packages/squiggle-lang/src/rescript/Utility/E/E_A.res
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ module R = {
let forM = (x: array<'a>, fn: 'a => result<'b, 'c>): result<array<'b>, '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)
Expand Down

0 comments on commit a89599f

Please sign in to comment.