Removed unit from DistPlus

This commit is contained in:
Ozzie Gooen 2022-04-04 11:44:42 -04:00
parent ea68f4d40b
commit a5db33cedf
3 changed files with 2 additions and 16 deletions

View File

@ -30,7 +30,7 @@ let truncate: (
~toPointSetFn: toPointSetFn, ~toPointSetFn: toPointSetFn,
~leftCutoff: option<float>=?, ~leftCutoff: option<float>=?,
~rightCutoff: option<float>=?, ~rightCutoff: option<float>=?,
unit, unit
) => result<t, error> ) => result<t, error>
let algebraicCombination: ( let algebraicCombination: (

View File

@ -9,12 +9,11 @@ let make =
~pointSetDist, ~pointSetDist,
~squiggleString, ~squiggleString,
~domain=Complete, ~domain=Complete,
~unit=UnspecifiedDistribution,
(), (),
) )
: t => { : t => {
let integral = pointSetDistIntegral(pointSetDist); let integral = pointSetDistIntegral(pointSetDist);
{pointSetDist, domain, integralCache: integral, unit, squiggleString}; {pointSetDist, domain, integralCache: integral, squiggleString};
}; };
let update = let update =
@ -22,14 +21,12 @@ let update =
~pointSetDist=?, ~pointSetDist=?,
~integralCache=?, ~integralCache=?,
~domain=?, ~domain=?,
~unit=?,
~squiggleString=?, ~squiggleString=?,
t: t, t: t,
) => { ) => {
pointSetDist: E.O.default(t.pointSetDist, pointSetDist), pointSetDist: E.O.default(t.pointSetDist, pointSetDist),
integralCache: E.O.default(t.integralCache, integralCache), integralCache: E.O.default(t.integralCache, integralCache),
domain: E.O.default(t.domain, domain), domain: E.O.default(t.domain, domain),
unit: E.O.default(t.unit, unit),
squiggleString: E.O.default(t.squiggleString, squiggleString), squiggleString: E.O.default(t.squiggleString, squiggleString),
}; };

View File

@ -71,25 +71,14 @@ type generationSource =
| SquiggleString(string) | SquiggleString(string)
| Shape(pointSetDist) | Shape(pointSetDist)
type distributionUnit =
| UnspecifiedDistribution
@genType @genType
type distPlus = { type distPlus = {
pointSetDist: pointSetDist, pointSetDist: pointSetDist,
domain: domain, domain: domain,
integralCache: continuousShape, integralCache: continuousShape,
unit: distributionUnit,
squiggleString: option<string>, squiggleString: option<string>,
} }
module DistributionUnit = {
let toJson = (distributionUnit: distributionUnit) =>
switch distributionUnit {
| _ => Js.Null.fromOption(None)
}
}
module Domain = { module Domain = {
let excludedProbabilityMass = (t: domain) => let excludedProbabilityMass = (t: domain) =>
switch t { switch t {