From 60b760f0cdd007c1d89f7506f203f8fdeb55f64c Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 4 Apr 2022 11:59:14 -0400 Subject: [PATCH] Naming refactor of key rescript directories --- .../__tests__/GenericDist/GenericOperation__Test.res | 10 +++++----- .../DistributionOperation/DistributionOperation.res} | 0 .../DistributionOperation/DistributionOperation.resi} | 0 .../{ => Distributions}/GenericDist/GenericDist.res | 0 .../{ => Distributions}/GenericDist/GenericDist.resi | 0 .../GenericDist/GenericDist_Types.res | 0 .../rescript/{ => Distributions}/GenericDist/README.md | 0 .../PointSetDist}/AlgebraicShapeCombination.res | 0 .../PointSetDist}/Continuous.res | 0 .../PointSetDist}/Discrete.res | 0 .../PointSetDist}/Distributions.res | 0 .../PointSetDist}/Mixed.res | 0 .../PointSetDist}/MixedShapeBuilder.res | 0 .../PointSetDist}/PointSetDist.res | 0 .../PointSetDist}/PointSetTypes.res | 0 .../PointSetDist}/XYShape.res | 0 .../SampleSetDist}/Bandwidth.res | 0 .../SampleSetDist}/KdeLibrary.js | 0 .../SampleSetDist}/SampleSet.res | 0 .../SymbolicDist}/SymbolicDist.res | 0 .../SymbolicDist}/SymbolicDistTypes.res | 0 .../src/rescript/{parser => OldParser}/Parser.res | 0 .../ReducerInterface_GenericDistribution.res | 8 ++++---- .../rescript/{interpreter => oldInterpreter}/AST.res | 0 .../{interpreter => oldInterpreter}/ASTEvaluator.res | 0 .../{interpreter => oldInterpreter}/ASTTypes.res | 0 .../{pointSetDist => oldInterpreter}/DistPlus.res | 0 .../typeSystem/HardcodedFunctions.res | 0 .../typeSystem/TypeSystem.res | 0 29 files changed, 9 insertions(+), 9 deletions(-) rename packages/squiggle-lang/src/rescript/{GenericDist/GenericDist_GenericOperation.res => Distributions/DistributionOperation/DistributionOperation.res} (100%) rename packages/squiggle-lang/src/rescript/{GenericDist/GenericDist_GenericOperation.resi => Distributions/DistributionOperation/DistributionOperation.resi} (100%) rename packages/squiggle-lang/src/rescript/{ => Distributions}/GenericDist/GenericDist.res (100%) rename packages/squiggle-lang/src/rescript/{ => Distributions}/GenericDist/GenericDist.resi (100%) rename packages/squiggle-lang/src/rescript/{ => Distributions}/GenericDist/GenericDist_Types.res (100%) rename packages/squiggle-lang/src/rescript/{ => Distributions}/GenericDist/README.md (100%) rename packages/squiggle-lang/src/rescript/{pointSetDist => Distributions/PointSetDist}/AlgebraicShapeCombination.res (100%) rename packages/squiggle-lang/src/rescript/{pointSetDist => Distributions/PointSetDist}/Continuous.res (100%) rename packages/squiggle-lang/src/rescript/{pointSetDist => Distributions/PointSetDist}/Discrete.res (100%) rename packages/squiggle-lang/src/rescript/{pointSetDist => Distributions/PointSetDist}/Distributions.res (100%) rename packages/squiggle-lang/src/rescript/{pointSetDist => Distributions/PointSetDist}/Mixed.res (100%) rename packages/squiggle-lang/src/rescript/{pointSetDist => Distributions/PointSetDist}/MixedShapeBuilder.res (100%) rename packages/squiggle-lang/src/rescript/{pointSetDist => Distributions/PointSetDist}/PointSetDist.res (100%) rename packages/squiggle-lang/src/rescript/{pointSetDist => Distributions/PointSetDist}/PointSetTypes.res (100%) rename packages/squiggle-lang/src/rescript/{pointSetDist => Distributions/PointSetDist}/XYShape.res (100%) rename packages/squiggle-lang/src/rescript/{sampleSet => Distributions/SampleSetDist}/Bandwidth.res (100%) rename packages/squiggle-lang/src/rescript/{sampleSet => Distributions/SampleSetDist}/KdeLibrary.js (100%) rename packages/squiggle-lang/src/rescript/{sampleSet => Distributions/SampleSetDist}/SampleSet.res (100%) rename packages/squiggle-lang/src/rescript/{symbolicDist => Distributions/SymbolicDist}/SymbolicDist.res (100%) rename packages/squiggle-lang/src/rescript/{symbolicDist => Distributions/SymbolicDist}/SymbolicDistTypes.res (100%) rename packages/squiggle-lang/src/rescript/{parser => OldParser}/Parser.res (100%) rename packages/squiggle-lang/src/rescript/{interpreter => oldInterpreter}/AST.res (100%) rename packages/squiggle-lang/src/rescript/{interpreter => oldInterpreter}/ASTEvaluator.res (100%) rename packages/squiggle-lang/src/rescript/{interpreter => oldInterpreter}/ASTTypes.res (100%) rename packages/squiggle-lang/src/rescript/{pointSetDist => oldInterpreter}/DistPlus.res (100%) rename packages/squiggle-lang/src/rescript/{interpreter => oldInterpreter}/typeSystem/HardcodedFunctions.res (100%) rename packages/squiggle-lang/src/rescript/{interpreter => oldInterpreter}/typeSystem/TypeSystem.res (100%) diff --git a/packages/squiggle-lang/__tests__/GenericDist/GenericOperation__Test.res b/packages/squiggle-lang/__tests__/GenericDist/GenericOperation__Test.res index 90d5a67c..aa921892 100644 --- a/packages/squiggle-lang/__tests__/GenericDist/GenericOperation__Test.res +++ b/packages/squiggle-lang/__tests__/GenericDist/GenericOperation__Test.res @@ -1,7 +1,7 @@ open Jest open Expect -let env: GenericDist_GenericOperation.env = { +let env: DistributionOperation.env = { sampleCount: 100, xyPointLength: 100, } @@ -11,9 +11,9 @@ let normalDist10: GenericDist_Types.genericDist = Symbolic(#Normal({mean: 10.0, let normalDist20: GenericDist_Types.genericDist = Symbolic(#Normal({mean: 20.0, stdev: 2.0})) let uniformDist: GenericDist_Types.genericDist = Symbolic(#Uniform({low: 9.0, high: 10.0})) -let {toFloat, toDist, toString, toError} = module(GenericDist_GenericOperation.Output) -let {run} = module(GenericDist_GenericOperation) -let {fmap} = module(GenericDist_GenericOperation.Output) +let {toFloat, toDist, toString, toError} = module(DistributionOperation.Output) +let {run} = module(DistributionOperation) +let {fmap} = module(DistributionOperation.Output) let run = run(~env) let outputMap = fmap(~env) let toExt: option<'a> => 'a = E.O.toExt( @@ -29,7 +29,7 @@ describe("normalize", () => { describe("mean", () => { test("for a normal distribution", () => { - let result = GenericDist_GenericOperation.run(~env, FromDist(ToFloat(#Mean), normalDist)) + let result = DistributionOperation.run(~env, FromDist(ToFloat(#Mean), normalDist)) expect(result)->toEqual(Float(5.0)) }) }) diff --git a/packages/squiggle-lang/src/rescript/GenericDist/GenericDist_GenericOperation.res b/packages/squiggle-lang/src/rescript/Distributions/DistributionOperation/DistributionOperation.res similarity index 100% rename from packages/squiggle-lang/src/rescript/GenericDist/GenericDist_GenericOperation.res rename to packages/squiggle-lang/src/rescript/Distributions/DistributionOperation/DistributionOperation.res diff --git a/packages/squiggle-lang/src/rescript/GenericDist/GenericDist_GenericOperation.resi b/packages/squiggle-lang/src/rescript/Distributions/DistributionOperation/DistributionOperation.resi similarity index 100% rename from packages/squiggle-lang/src/rescript/GenericDist/GenericDist_GenericOperation.resi rename to packages/squiggle-lang/src/rescript/Distributions/DistributionOperation/DistributionOperation.resi diff --git a/packages/squiggle-lang/src/rescript/GenericDist/GenericDist.res b/packages/squiggle-lang/src/rescript/Distributions/GenericDist/GenericDist.res similarity index 100% rename from packages/squiggle-lang/src/rescript/GenericDist/GenericDist.res rename to packages/squiggle-lang/src/rescript/Distributions/GenericDist/GenericDist.res diff --git a/packages/squiggle-lang/src/rescript/GenericDist/GenericDist.resi b/packages/squiggle-lang/src/rescript/Distributions/GenericDist/GenericDist.resi similarity index 100% rename from packages/squiggle-lang/src/rescript/GenericDist/GenericDist.resi rename to packages/squiggle-lang/src/rescript/Distributions/GenericDist/GenericDist.resi diff --git a/packages/squiggle-lang/src/rescript/GenericDist/GenericDist_Types.res b/packages/squiggle-lang/src/rescript/Distributions/GenericDist/GenericDist_Types.res similarity index 100% rename from packages/squiggle-lang/src/rescript/GenericDist/GenericDist_Types.res rename to packages/squiggle-lang/src/rescript/Distributions/GenericDist/GenericDist_Types.res diff --git a/packages/squiggle-lang/src/rescript/GenericDist/README.md b/packages/squiggle-lang/src/rescript/Distributions/GenericDist/README.md similarity index 100% rename from packages/squiggle-lang/src/rescript/GenericDist/README.md rename to packages/squiggle-lang/src/rescript/Distributions/GenericDist/README.md diff --git a/packages/squiggle-lang/src/rescript/pointSetDist/AlgebraicShapeCombination.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/AlgebraicShapeCombination.res similarity index 100% rename from packages/squiggle-lang/src/rescript/pointSetDist/AlgebraicShapeCombination.res rename to packages/squiggle-lang/src/rescript/Distributions/PointSetDist/AlgebraicShapeCombination.res diff --git a/packages/squiggle-lang/src/rescript/pointSetDist/Continuous.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Continuous.res similarity index 100% rename from packages/squiggle-lang/src/rescript/pointSetDist/Continuous.res rename to packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Continuous.res diff --git a/packages/squiggle-lang/src/rescript/pointSetDist/Discrete.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res similarity index 100% rename from packages/squiggle-lang/src/rescript/pointSetDist/Discrete.res rename to packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Discrete.res diff --git a/packages/squiggle-lang/src/rescript/pointSetDist/Distributions.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Distributions.res similarity index 100% rename from packages/squiggle-lang/src/rescript/pointSetDist/Distributions.res rename to packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Distributions.res diff --git a/packages/squiggle-lang/src/rescript/pointSetDist/Mixed.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Mixed.res similarity index 100% rename from packages/squiggle-lang/src/rescript/pointSetDist/Mixed.res rename to packages/squiggle-lang/src/rescript/Distributions/PointSetDist/Mixed.res diff --git a/packages/squiggle-lang/src/rescript/pointSetDist/MixedShapeBuilder.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/MixedShapeBuilder.res similarity index 100% rename from packages/squiggle-lang/src/rescript/pointSetDist/MixedShapeBuilder.res rename to packages/squiggle-lang/src/rescript/Distributions/PointSetDist/MixedShapeBuilder.res diff --git a/packages/squiggle-lang/src/rescript/pointSetDist/PointSetDist.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist.res similarity index 100% rename from packages/squiggle-lang/src/rescript/pointSetDist/PointSetDist.res rename to packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetDist.res diff --git a/packages/squiggle-lang/src/rescript/pointSetDist/PointSetTypes.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetTypes.res similarity index 100% rename from packages/squiggle-lang/src/rescript/pointSetDist/PointSetTypes.res rename to packages/squiggle-lang/src/rescript/Distributions/PointSetDist/PointSetTypes.res diff --git a/packages/squiggle-lang/src/rescript/pointSetDist/XYShape.res b/packages/squiggle-lang/src/rescript/Distributions/PointSetDist/XYShape.res similarity index 100% rename from packages/squiggle-lang/src/rescript/pointSetDist/XYShape.res rename to packages/squiggle-lang/src/rescript/Distributions/PointSetDist/XYShape.res diff --git a/packages/squiggle-lang/src/rescript/sampleSet/Bandwidth.res b/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/Bandwidth.res similarity index 100% rename from packages/squiggle-lang/src/rescript/sampleSet/Bandwidth.res rename to packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/Bandwidth.res diff --git a/packages/squiggle-lang/src/rescript/sampleSet/KdeLibrary.js b/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/KdeLibrary.js similarity index 100% rename from packages/squiggle-lang/src/rescript/sampleSet/KdeLibrary.js rename to packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/KdeLibrary.js diff --git a/packages/squiggle-lang/src/rescript/sampleSet/SampleSet.res b/packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSet.res similarity index 100% rename from packages/squiggle-lang/src/rescript/sampleSet/SampleSet.res rename to packages/squiggle-lang/src/rescript/Distributions/SampleSetDist/SampleSet.res diff --git a/packages/squiggle-lang/src/rescript/symbolicDist/SymbolicDist.res b/packages/squiggle-lang/src/rescript/Distributions/SymbolicDist/SymbolicDist.res similarity index 100% rename from packages/squiggle-lang/src/rescript/symbolicDist/SymbolicDist.res rename to packages/squiggle-lang/src/rescript/Distributions/SymbolicDist/SymbolicDist.res diff --git a/packages/squiggle-lang/src/rescript/symbolicDist/SymbolicDistTypes.res b/packages/squiggle-lang/src/rescript/Distributions/SymbolicDist/SymbolicDistTypes.res similarity index 100% rename from packages/squiggle-lang/src/rescript/symbolicDist/SymbolicDistTypes.res rename to packages/squiggle-lang/src/rescript/Distributions/SymbolicDist/SymbolicDistTypes.res diff --git a/packages/squiggle-lang/src/rescript/parser/Parser.res b/packages/squiggle-lang/src/rescript/OldParser/Parser.res similarity index 100% rename from packages/squiggle-lang/src/rescript/parser/Parser.res rename to packages/squiggle-lang/src/rescript/OldParser/Parser.res diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res index 8fabdfa8..84e0697f 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res @@ -1,7 +1,7 @@ module ExpressionValue = ReducerInterface_ExpressionValue type expressionValue = ReducerInterface_ExpressionValue.expressionValue -let runGenericOperation = GenericDist_GenericOperation.run( +let runGenericOperation = DistributionOperation.run( ~env={ sampleCount: 1000, xyPointLength: 1000, @@ -86,7 +86,7 @@ module SymbolicConstructors = { let symbolicResultToOutput = ( symbolicResult: result, - ): option => + ): option => switch symbolicResult { | Ok(r) => Some(Dist(Symbolic(r))) | Error(r) => Some(GenDistError(Other(r))) @@ -98,7 +98,7 @@ module Math = { } let dispatchToGenericOutput = (call: ExpressionValue.functionCall): option< - GenericDist_GenericOperation.outputType, + DistributionOperation.outputType, > => { let (fnName, args) = call switch (fnName, args) { @@ -165,7 +165,7 @@ let dispatchToGenericOutput = (call: ExpressionValue.functionCall): option< } } -let genericOutputToReducerValue = (o: GenericDist_GenericOperation.outputType): result< +let genericOutputToReducerValue = (o: DistributionOperation.outputType): result< expressionValue, Reducer_ErrorValue.errorValue, > => diff --git a/packages/squiggle-lang/src/rescript/interpreter/AST.res b/packages/squiggle-lang/src/rescript/oldInterpreter/AST.res similarity index 100% rename from packages/squiggle-lang/src/rescript/interpreter/AST.res rename to packages/squiggle-lang/src/rescript/oldInterpreter/AST.res diff --git a/packages/squiggle-lang/src/rescript/interpreter/ASTEvaluator.res b/packages/squiggle-lang/src/rescript/oldInterpreter/ASTEvaluator.res similarity index 100% rename from packages/squiggle-lang/src/rescript/interpreter/ASTEvaluator.res rename to packages/squiggle-lang/src/rescript/oldInterpreter/ASTEvaluator.res diff --git a/packages/squiggle-lang/src/rescript/interpreter/ASTTypes.res b/packages/squiggle-lang/src/rescript/oldInterpreter/ASTTypes.res similarity index 100% rename from packages/squiggle-lang/src/rescript/interpreter/ASTTypes.res rename to packages/squiggle-lang/src/rescript/oldInterpreter/ASTTypes.res diff --git a/packages/squiggle-lang/src/rescript/pointSetDist/DistPlus.res b/packages/squiggle-lang/src/rescript/oldInterpreter/DistPlus.res similarity index 100% rename from packages/squiggle-lang/src/rescript/pointSetDist/DistPlus.res rename to packages/squiggle-lang/src/rescript/oldInterpreter/DistPlus.res diff --git a/packages/squiggle-lang/src/rescript/interpreter/typeSystem/HardcodedFunctions.res b/packages/squiggle-lang/src/rescript/oldInterpreter/typeSystem/HardcodedFunctions.res similarity index 100% rename from packages/squiggle-lang/src/rescript/interpreter/typeSystem/HardcodedFunctions.res rename to packages/squiggle-lang/src/rescript/oldInterpreter/typeSystem/HardcodedFunctions.res diff --git a/packages/squiggle-lang/src/rescript/interpreter/typeSystem/TypeSystem.res b/packages/squiggle-lang/src/rescript/oldInterpreter/typeSystem/TypeSystem.res similarity index 100% rename from packages/squiggle-lang/src/rescript/interpreter/typeSystem/TypeSystem.res rename to packages/squiggle-lang/src/rescript/oldInterpreter/typeSystem/TypeSystem.res