ERecord->toString, fix warning

This commit is contained in:
Vyacheslav Matyukhin 2022-09-17 00:41:58 +04:00
parent f62e90fa98
commit 89397d3584
No known key found for this signature in database
GPG Key ID: 3D2A774C5489F96C
2 changed files with 2 additions and 2 deletions

View File

@ -245,7 +245,7 @@ module DiminishingReturns = {
optimalAllocations: array<float>,
currentMarginalReturns: result<array<float>, errorValue>,
}
let findBiggestElementIndex = xs =>
let findBiggestElementIndex = (xs: array<float>) =>
E.A.reducei(xs, 0, (acc, newElement, index) => {
switch newElement > xs[acc] {
| true => index

View File

@ -30,7 +30,7 @@ let rec toString = (expression: expression) =>
| EBlock(statements) => `{${Js.Array2.map(statements, aValue => toString(aValue))->commaJoin}}`
| EProgram(statements) => `<${Js.Array2.map(statements, aValue => toString(aValue))->commaJoin}>`
| EArray(aList) => `[${Js.Array2.map(aList, aValue => toString(aValue))->commaJoin}]`
| ERecord(map) => "TODO"
| ERecord(map) => `{${map->Belt.Array.map(((key, value)) => `${key->toString}: ${value->toString}`)->Js.Array2.toString}}`
| ESymbol(name) => name
| ETernary(predicate, trueCase, falseCase) =>
`${predicate->toString} ? (${trueCase->toString}) : (${falseCase->toString})`