Reorder function declarations to compile

This commit is contained in:
Sam Nolan 2022-07-19 11:45:07 +10:00
parent 5bdc19f35f
commit 7887256ca1

View File

@ -150,16 +150,6 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce
SampleSetDist.map3(~fn, ~t1, ~t2, ~t3)->toType SampleSetDist.map3(~fn, ~t1, ~t2, ~t3)->toType
} }
let mapN = (aValueArray: array<internalExpressionValue>, 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<internalExpressionValue>): option< let parseSampleSetArray = (arr: array<internalExpressionValue>): option<
array<SampleSetDist.t>, array<SampleSetDist.t>,
> => { > => {
@ -170,6 +160,16 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce
} }
E.A.O.openIfAllSome(E.A.fmap(parseSampleSet, arr)) E.A.O.openIfAllSome(E.A.fmap(parseSampleSet, arr))
} }
let mapN = (aValueArray: array<internalExpressionValue>, 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) => { let doReduceArray = (aValueArray, initialValue, aLambdaValue) => {