Naming refactor of key rescript directories
This commit is contained in:
parent
51711512fb
commit
60b760f0cd
|
@ -1,7 +1,7 @@
|
||||||
open Jest
|
open Jest
|
||||||
open Expect
|
open Expect
|
||||||
|
|
||||||
let env: GenericDist_GenericOperation.env = {
|
let env: DistributionOperation.env = {
|
||||||
sampleCount: 100,
|
sampleCount: 100,
|
||||||
xyPointLength: 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 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 uniformDist: GenericDist_Types.genericDist = Symbolic(#Uniform({low: 9.0, high: 10.0}))
|
||||||
|
|
||||||
let {toFloat, toDist, toString, toError} = module(GenericDist_GenericOperation.Output)
|
let {toFloat, toDist, toString, toError} = module(DistributionOperation.Output)
|
||||||
let {run} = module(GenericDist_GenericOperation)
|
let {run} = module(DistributionOperation)
|
||||||
let {fmap} = module(GenericDist_GenericOperation.Output)
|
let {fmap} = module(DistributionOperation.Output)
|
||||||
let run = run(~env)
|
let run = run(~env)
|
||||||
let outputMap = fmap(~env)
|
let outputMap = fmap(~env)
|
||||||
let toExt: option<'a> => 'a = E.O.toExt(
|
let toExt: option<'a> => 'a = E.O.toExt(
|
||||||
|
@ -29,7 +29,7 @@ describe("normalize", () => {
|
||||||
|
|
||||||
describe("mean", () => {
|
describe("mean", () => {
|
||||||
test("for a normal distribution", () => {
|
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))
|
expect(result)->toEqual(Float(5.0))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module ExpressionValue = ReducerInterface_ExpressionValue
|
module ExpressionValue = ReducerInterface_ExpressionValue
|
||||||
type expressionValue = ReducerInterface_ExpressionValue.expressionValue
|
type expressionValue = ReducerInterface_ExpressionValue.expressionValue
|
||||||
|
|
||||||
let runGenericOperation = GenericDist_GenericOperation.run(
|
let runGenericOperation = DistributionOperation.run(
|
||||||
~env={
|
~env={
|
||||||
sampleCount: 1000,
|
sampleCount: 1000,
|
||||||
xyPointLength: 1000,
|
xyPointLength: 1000,
|
||||||
|
@ -86,7 +86,7 @@ module SymbolicConstructors = {
|
||||||
|
|
||||||
let symbolicResultToOutput = (
|
let symbolicResultToOutput = (
|
||||||
symbolicResult: result<SymbolicDistTypes.symbolicDist, string>,
|
symbolicResult: result<SymbolicDistTypes.symbolicDist, string>,
|
||||||
): option<GenericDist_GenericOperation.outputType> =>
|
): option<DistributionOperation.outputType> =>
|
||||||
switch symbolicResult {
|
switch symbolicResult {
|
||||||
| Ok(r) => Some(Dist(Symbolic(r)))
|
| Ok(r) => Some(Dist(Symbolic(r)))
|
||||||
| Error(r) => Some(GenDistError(Other(r)))
|
| Error(r) => Some(GenDistError(Other(r)))
|
||||||
|
@ -98,7 +98,7 @@ module Math = {
|
||||||
}
|
}
|
||||||
|
|
||||||
let dispatchToGenericOutput = (call: ExpressionValue.functionCall): option<
|
let dispatchToGenericOutput = (call: ExpressionValue.functionCall): option<
|
||||||
GenericDist_GenericOperation.outputType,
|
DistributionOperation.outputType,
|
||||||
> => {
|
> => {
|
||||||
let (fnName, args) = call
|
let (fnName, args) = call
|
||||||
switch (fnName, args) {
|
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,
|
expressionValue,
|
||||||
Reducer_ErrorValue.errorValue,
|
Reducer_ErrorValue.errorValue,
|
||||||
> =>
|
> =>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user