From 27611ee7bf1f157ca9627a5a1432f04bc2695f36 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sun, 8 Nov 2020 18:30:25 -0800 Subject: [PATCH] Minor cleanup --- .../expressionTree/ExpressionTreeEvaluator.re | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/distPlus/expressionTree/ExpressionTreeEvaluator.re b/src/distPlus/expressionTree/ExpressionTreeEvaluator.re index 6687723e..086d2ebf 100644 --- a/src/distPlus/expressionTree/ExpressionTreeEvaluator.re +++ b/src/distPlus/expressionTree/ExpressionTreeEvaluator.re @@ -241,7 +241,7 @@ module FunctionCall = { |> E.O.default(_runLocalFunction(name, evaluationParams, args)); }; -// TODO: This forces things to be floats + // TODO: This forces things to be floats let run = (evaluationParams, name, args) => { args |> E.A.fmap(a => evaluationParams.evaluateNode(evaluationParams, a)) @@ -250,7 +250,6 @@ module FunctionCall = { }; }; - module Render = { let rec operationToLeaf = (evaluationParams: evaluationParams, t: node): result(t, string) => { @@ -284,18 +283,16 @@ let rec toLeaf = node: t, ) : result(t, string) => { - Js.log2("node", node); switch (node) { // Leaf nodes just stay leaf nodes | `SymbolicDist(_) | `Function(_) | `RenderedDist(_) => Ok(node) | `Array(args) => - Js.log2("Array!", args); args |> E.A.fmap(toLeaf(evaluationParams)) |> E.A.R.firstErrorOrOpen - |> E.R.fmap(r => `Array(r)); + |> E.R.fmap(r => `Array(r)) // Operations nevaluationParamsd to be turned into leaves | `AlgebraicCombination(algebraicOp, t1, t2) => AlgebraicCombination.operationToLeaf( @@ -316,24 +313,21 @@ let rec toLeaf = | `Normalize(t) => Normalize.operationToLeaf(evaluationParams, t) | `Render(t) => Render.operationToLeaf(evaluationParams, t) | `Hash(t) => - Js.log("In hash"); t |> E.A.fmap(((name: string, node: node)) => toLeaf(evaluationParams, node) |> E.R.fmap(r => (name, r)) ) |> E.A.R.firstErrorOrOpen - |> E.R.fmap(r => `Hash(r)); + |> E.R.fmap(r => `Hash(r)) | `Symbol(r) => - Js.log("Symbol"); ExpressionTypes.ExpressionTree.Environment.get( evaluationParams.environment, r, ) |> E.O.toResult("Undeclared variable " ++ r) - |> E.R.bind(_, toLeaf(evaluationParams)); + |> E.R.bind(_, toLeaf(evaluationParams)) | `FunctionCall(name, args) => - Js.log3("In function call", name, args); FunctionCall.run(evaluationParams, name, args) - |> E.R.bind(_, toLeaf(evaluationParams)); + |> E.R.bind(_, toLeaf(evaluationParams)) }; };