From 7887256ca10f5697d03e934866dbd5782cd502b8 Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Tue, 19 Jul 2022 11:45:07 +1000 Subject: [PATCH] Reorder function declarations to compile --- .../Reducer_Dispatch_BuiltIn.res | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res index 40903521..f0d8b3ab 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res @@ -150,16 +150,6 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce SampleSetDist.map3(~fn, ~t1, ~t2, ~t3)->toType } - let mapN = (aValueArray: array, aLambdaValue) => { - switch parseSampleSetArray(aValueArray) { - | Some(t1) => - let fn = a => doLambdaCall(aLambdaValue, list{IEvArray(E.A.fmap(x => IEvNumber(x), a))}) - SampleSetDist.mapN(~fn, ~t1)->toType - | None => - Error(REFunctionNotFound(call->functionCallToCallSignature->functionCallSignatureToString)) - } - } - let parseSampleSetArray = (arr: array): option< array, > => { @@ -170,6 +160,16 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce } E.A.O.openIfAllSome(E.A.fmap(parseSampleSet, arr)) } + + let mapN = (aValueArray: array, aLambdaValue) => { + switch parseSampleSetArray(aValueArray) { + | Some(t1) => + let fn = a => doLambdaCall(aLambdaValue, list{IEvArray(E.A.fmap(x => IEvNumber(x), a))}) + SampleSetDist.mapN(~fn, ~t1)->toType + | None => + Error(REFunctionNotFound(call->functionCallToCallSignature->functionCallSignatureToString)) + } + } } let doReduceArray = (aValueArray, initialValue, aLambdaValue) => {