2022-04-08 18:42:14 +00:00
|
|
|
@genType
|
2022-03-31 18:07:39 +00:00
|
|
|
type env = {
|
2022-03-28 12:39:07 +00:00
|
|
|
sampleCount: int,
|
|
|
|
xyPointLength: int,
|
|
|
|
}
|
|
|
|
|
2022-04-08 18:42:14 +00:00
|
|
|
@genType
|
2022-03-31 13:27:36 +00:00
|
|
|
type outputType =
|
|
|
|
| Dist(GenericDist_Types.genericDist)
|
|
|
|
| Float(float)
|
|
|
|
| String(string)
|
|
|
|
| GenDistError(GenericDist_Types.error)
|
2022-03-28 12:39:07 +00:00
|
|
|
|
2022-04-08 18:42:14 +00:00
|
|
|
@genType
|
2022-03-31 18:07:39 +00:00
|
|
|
let run: (~env: env, GenericDist_Types.Operation.genericFunctionCallInfo) => outputType
|
2022-03-28 19:14:39 +00:00
|
|
|
let runFromDist: (
|
2022-03-31 18:07:39 +00:00
|
|
|
~env: env,
|
|
|
|
~functionCallInfo: GenericDist_Types.Operation.fromDist,
|
2022-03-28 19:14:39 +00:00
|
|
|
GenericDist_Types.genericDist,
|
|
|
|
) => outputType
|
2022-03-31 18:15:21 +00:00
|
|
|
let runFromFloat: (
|
|
|
|
~env: env,
|
|
|
|
~functionCallInfo: GenericDist_Types.Operation.fromDist,
|
|
|
|
float,
|
|
|
|
) => outputType
|
2022-03-28 19:14:39 +00:00
|
|
|
|
|
|
|
module Output: {
|
2022-03-31 17:26:29 +00:00
|
|
|
type t = outputType
|
|
|
|
let toDist: t => option<GenericDist_Types.genericDist>
|
|
|
|
let toDistR: t => result<GenericDist_Types.genericDist, GenericDist_Types.error>
|
|
|
|
let toFloat: t => option<float>
|
2022-03-31 23:58:08 +00:00
|
|
|
let toFloatR: t => result<float, GenericDist_Types.error>
|
2022-03-31 17:26:29 +00:00
|
|
|
let toString: t => option<string>
|
2022-03-31 23:58:08 +00:00
|
|
|
let toStringR: t => result<string, GenericDist_Types.error>
|
2022-03-31 17:26:29 +00:00
|
|
|
let toError: t => option<GenericDist_Types.error>
|
2022-03-31 18:07:39 +00:00
|
|
|
let fmap: (~env: env, t, GenericDist_Types.Operation.singleParamaterFunction) => t
|
|
|
|
}
|
2022-04-08 18:42:14 +00:00
|
|
|
|
|
|
|
module Constructors: {
|
|
|
|
module UsingDists: {
|
|
|
|
type dist = GenericDist_Types.genericDist
|
|
|
|
type fResult = result<float, GenericDist_Types.error>
|
|
|
|
type dResult = result<dist, GenericDist_Types.error>
|
|
|
|
type sResult = result<string, GenericDist_Types.error>
|
|
|
|
let mean: (~env: env, dist) => fResult
|
|
|
|
let sample: (~env: env, dist) => fResult
|
|
|
|
let cdf: (~env: env, dist, float) => fResult
|
|
|
|
let inv: (~env: env, dist, float) => fResult
|
|
|
|
let pdf: (~env: env, dist, float) => fResult
|
|
|
|
let normalize: (~env: env, dist) => dResult
|
|
|
|
let toPointSet: (~env: env, dist) => dResult
|
|
|
|
let toSampleSet: (~env: env, dist, int) => dResult
|
|
|
|
let truncate: (~env: env, dist, option<float>, option<float>) => dResult
|
|
|
|
let inspect: (~env: env, dist) => dResult
|
|
|
|
let toString: (~env: env, dist) => sResult
|
|
|
|
let toSparkline: (~env: env, dist, int) => sResult
|
|
|
|
let algebraicAdd: (~env: env, dist, dist) => dResult
|
|
|
|
let algebraicMultiply: (~env: env, dist, dist) => dResult
|
|
|
|
let algebraicDivide: (~env: env, dist, dist) => dResult
|
|
|
|
let algebraicSubtract: (~env: env, dist, dist) => dResult
|
|
|
|
let algebraicLogarithm: (~env: env, dist, dist) => dResult
|
|
|
|
let algebraicExponentiate: (~env: env, dist, dist) => dResult
|
|
|
|
let pointwiseAdd: (~env: env, dist, dist) => dResult
|
|
|
|
let pointwiseMultiply: (~env: env, dist, dist) => dResult
|
|
|
|
let pointwiseDivide: (~env: env, dist, dist) => dResult
|
|
|
|
let pointwiseSubtract: (~env: env, dist, dist) => dResult
|
|
|
|
let pointwiseLogarithm: (~env: env, dist, dist) => dResult
|
|
|
|
let pointwiseExponentiate: (~env: env, dist, dist) => dResult
|
|
|
|
}
|
|
|
|
}
|