squiggle/packages/squiggle-lang/src/rescript/Distributions/GenericDist/GenericDist.resi

71 lines
1.8 KiB
Plaintext
Raw Normal View History

type t = DistributionTypes.genericDist
type error = DistributionTypes.error
2022-03-28 12:39:07 +00:00
type toPointSetFn = t => result<PointSetTypes.pointSetDist, error>
2022-04-09 22:10:06 +00:00
type toSampleSetFn = t => result<SampleSetDist.t, error>
2022-03-28 12:39:07 +00:00
type scaleMultiplyFn = (t, float) => result<t, error>
type pointwiseAddFn = (t, t) => result<t, error>
let sampleN: (t, int) => array<float>
2022-04-09 22:10:06 +00:00
let toSampleSetDist: (t, int) => Belt.Result.t<QuriSquiggleLang.SampleSetDist.t, error>
2022-03-28 12:39:07 +00:00
let fromFloat: float => t
let toString: t => string
let normalize: t => t
let isNormalized: t => bool
let toFloatOperation: (
t,
~toPointSetFn: toPointSetFn,
~distToFloatOperation: Operation.distToFloatOperation,
) => result<float, error>
2022-03-28 12:39:07 +00:00
2022-04-11 06:16:29 +00:00
@genType
let toPointSet: (
t,
~xyPointLength: int,
~sampleCount: int,
~xSelection: DistributionTypes.Operation.pointsetXSelection=?,
unit,
) => result<PointSetTypes.pointSetDist, error>
2022-04-09 02:55:06 +00:00
let toSparkline: (t, ~sampleCount: int, ~bucketCount: int=?, unit) => result<string, error>
2022-03-28 12:39:07 +00:00
let truncate: (
t,
~toPointSetFn: toPointSetFn,
~leftCutoff: option<float>=?,
~rightCutoff: option<float>=?,
unit,
) => result<t, error>
2022-03-28 12:39:07 +00:00
let algebraicCombination: (
2022-03-29 19:47:32 +00:00
t,
~toPointSetFn: toPointSetFn,
~toSampleSetFn: toSampleSetFn,
~arithmeticOperation: DistributionTypes.Operation.arithmeticOperation,
~t2: t,
2022-03-28 12:39:07 +00:00
) => result<t, error>
let pointwiseCombination: (
2022-03-29 19:47:32 +00:00
t,
~toPointSetFn: toPointSetFn,
~arithmeticOperation: DistributionTypes.Operation.arithmeticOperation,
~t2: t,
2022-03-28 12:39:07 +00:00
) => result<t, error>
let pointwiseCombinationFloat: (
2022-03-29 19:47:32 +00:00
t,
~toPointSetFn: toPointSetFn,
~arithmeticOperation: DistributionTypes.Operation.arithmeticOperation,
~f: float,
2022-03-28 12:39:07 +00:00
) => result<t, error>
let mixture: (
array<(t, float)>,
~scaleMultiplyFn: scaleMultiplyFn,
~pointwiseAddFn: pointwiseAddFn,
) => result<t, error>