Formatted code

This commit is contained in:
Ozzie Gooen 2022-07-13 10:11:59 -07:00
parent 4853df39bb
commit d8b1e0d5ff
4 changed files with 16 additions and 14 deletions

View File

@ -6,7 +6,7 @@ type error = DistributionTypes.error
type env = GenericDist.env
let defaultEnv:env = {
let defaultEnv: env = {
sampleCount: MagicNumbers.Environment.defaultSampleCount,
xyPointLength: MagicNumbers.Environment.defaultXYPointLength,
}
@ -90,7 +90,7 @@ module OutputLocal = {
}
}
let rec run = (~env:env, functionCallInfo: functionCallInfo): outputType => {
let rec run = (~env: env, functionCallInfo: functionCallInfo): outputType => {
let {sampleCount, xyPointLength} = env
let reCall = (~env=env, ~functionCallInfo=functionCallInfo, ()) => {

View File

@ -192,12 +192,10 @@ module Score = {
}
}
let logScore = (
~estimate: t,
~answer: genericDistOrScalar,
~prior: option<t>,
~env: env,
): result<float, error> =>
let logScore = (~estimate: t, ~answer: genericDistOrScalar, ~prior: option<t>, ~env: env): result<
float,
error,
> =>
argsMake(~esti=estimate, ~answ=answer, ~prior, ~env)->E.R.bind(x =>
x->PointSetDist.logScore->E.R2.errMap(y => DistributionTypes.OperationError(y))
)

View File

@ -32,7 +32,7 @@ module Score: {
~estimate: t,
~answer: DistributionTypes.DistributionOperation.genericDistOrScalar,
~prior: option<t>,
~env: env
~env: env,
) => result<float, error>
}

View File

@ -63,7 +63,10 @@ module Prepare = {
}
}
let twoDist = (values: ts): result<(DistributionTypes.genericDist, DistributionTypes.genericDist), err> => {
let twoDist = (values: ts): result<
(DistributionTypes.genericDist, DistributionTypes.genericDist),
err,
> => {
switch values {
| [FRValueDist(a1), FRValueDist(a2)] => Ok(a1, a2)
| _ => Error(impossibleError)
@ -95,8 +98,10 @@ module Prepare = {
let twoDistOrNumber = (values: ts): result<(frValueDistOrNumber, frValueDistOrNumber), err> =>
values->ToValueArray.Record.twoArgs->E.R.bind(twoDistOrNumber)
let twoDist = (values: ts): result<(DistributionTypes.genericDist, DistributionTypes.genericDist), err> =>
values->ToValueArray.Record.twoArgs->E.R.bind(twoDist)
let twoDist = (values: ts): result<
(DistributionTypes.genericDist, DistributionTypes.genericDist),
err,
> => values->ToValueArray.Record.twoArgs->E.R.bind(twoDist)
}
}
@ -144,8 +149,7 @@ module Prepare = {
module Process = {
module DistOrNumberToDist = {
module Helpers = {
let toSampleSet = (r, env: GenericDist.env) =>
GenericDist.toSampleSetDist(r, env.sampleCount)
let toSampleSet = (r, env: GenericDist.env) => GenericDist.toSampleSetDist(r, env.sampleCount)
let mapFnResult = r =>
switch r {