From c57cc3144e881f9885830a2000c290c8753a77a6 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 15 Aug 2020 08:38:43 +0100 Subject: [PATCH] Moved floatFromDist to Fn only --- src/distPlus/expressionTree/ExpressionTree.re | 2 -- .../expressionTree/ExpressionTreeEvaluator.re | 22 ------------------- .../expressionTree/ExpressionTypes.re | 1 - 3 files changed, 25 deletions(-) diff --git a/src/distPlus/expressionTree/ExpressionTree.re b/src/distPlus/expressionTree/ExpressionTree.re index f6de909b..6cbfe898 100644 --- a/src/distPlus/expressionTree/ExpressionTree.re +++ b/src/distPlus/expressionTree/ExpressionTree.re @@ -11,8 +11,6 @@ let rec toString: node => string = | `VerticalScaling(scaleOp, t, scaleBy) => Operation.Scale.format(scaleOp, toString(t), toString(scaleBy)) | `Normalize(t) => "normalize(k" ++ toString(t) ++ ")" - | `FloatFromDist(floatFromDistOp, t) => - Operation.DistToFloat.format(floatFromDistOp, toString(t)) | `Truncate(lc, rc, t) => Operation.T.truncateToString(lc, rc, toString(t)) | `Render(t) => toString(t) diff --git a/src/distPlus/expressionTree/ExpressionTreeEvaluator.re b/src/distPlus/expressionTree/ExpressionTreeEvaluator.re index 1942ace6..14500828 100644 --- a/src/distPlus/expressionTree/ExpressionTreeEvaluator.re +++ b/src/distPlus/expressionTree/ExpressionTreeEvaluator.re @@ -244,26 +244,6 @@ module Normalize = { }; }; -module FloatFromDist = { - let rec operationToLeaf = - (evaluationParams, distToFloatOp: distToFloatOperation, t: node) - : result(node, string) => { - switch (t) { - | `SymbolicDist(s) => - SymbolicDist.T.operate(distToFloatOp, s) - |> E.R.bind(_, v => Ok(`SymbolicDist(`Float(v)))) - | `RenderedDist(rs) => - Shape.operate(distToFloatOp, rs) - |> (v => Ok(`SymbolicDist(`Float(v)))) - | _ => - t - |> evaluateAndRetry(evaluationParams, r => - operationToLeaf(r, distToFloatOp) - ) - }; - }; -}; - // TODO: This forces things to be floats let callableFunction = (evaluationParams, name, args) => { args @@ -333,8 +313,6 @@ let rec toLeaf = VerticalScaling.operationToLeaf(evaluationParams, scaleOp, t, scaleBy) | `Truncate(leftCutoff, rightCutoff, t) => Truncate.operationToLeaf(evaluationParams, leftCutoff, rightCutoff, t) - | `FloatFromDist(distToFloatOp, t) => - FloatFromDist.operationToLeaf(evaluationParams, distToFloatOp, t) | `Normalize(t) => Normalize.operationToLeaf(evaluationParams, t) | `Render(t) => Render.operationToLeaf(evaluationParams, t) | `Hash(t) => diff --git a/src/distPlus/expressionTree/ExpressionTypes.re b/src/distPlus/expressionTree/ExpressionTypes.re index 1878e7b9..c9e1a63a 100644 --- a/src/distPlus/expressionTree/ExpressionTypes.re +++ b/src/distPlus/expressionTree/ExpressionTypes.re @@ -29,7 +29,6 @@ module ExpressionTree = { | `Normalize(node) | `Render(node) | `Truncate(option(float), option(float), node) - | `FloatFromDist(distToFloatOperation, node) | `FunctionCall(string, array(node)) | `MultiModal(array((node, float))) ];