remove -> in switch cases. close umuro/squiggle#59

squiggle
This commit is contained in:
Umur Ozkul 2022-04-12 16:15:27 +02:00
parent 4fe72b8fb4
commit 05b5efce18

View File

@ -70,18 +70,18 @@ let rec reduceExpression = (expression: t, bindings: T.bindings): result<express
} }
| T.EValue(_) => expression->Ok | T.EValue(_) => expression->Ok
| T.EBindings(_) => expression->Ok | T.EBindings(_) => expression->Ok
| T.EList(list) => | T.EList(list) => {
list let racc = list->Belt.List.reduceReverse(Ok(list{}), (racc, each: expression) =>
->Belt.List.reduceReverse(Ok(list{}), (racc, each: expression) => racc->Result.flatMap(acc => {
racc->Result.flatMap(acc => { each
each ->replaceSymbols(bindings)
->replaceSymbols(bindings) ->Result.flatMap(newNode => {
->Result.flatMap(newNode => { acc->Belt.List.add(newNode)->Ok
acc->Belt.List.add(newNode)->Ok })
}) })
}) )
) racc->Result.map(acc => acc->T.EList)
->Result.map(acc => acc->T.EList) }
} }
let doBindStatement = (statement: t, bindings: T.bindings) => { let doBindStatement = (statement: t, bindings: T.bindings) => {