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 type env = GenericDist.env
let defaultEnv:env = { let defaultEnv: env = {
sampleCount: MagicNumbers.Environment.defaultSampleCount, sampleCount: MagicNumbers.Environment.defaultSampleCount,
xyPointLength: MagicNumbers.Environment.defaultXYPointLength, 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 {sampleCount, xyPointLength} = env
let reCall = (~env=env, ~functionCallInfo=functionCallInfo, ()) => { let reCall = (~env=env, ~functionCallInfo=functionCallInfo, ()) => {

View File

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

View File

@ -32,7 +32,7 @@ module Score: {
~estimate: t, ~estimate: t,
~answer: DistributionTypes.DistributionOperation.genericDistOrScalar, ~answer: DistributionTypes.DistributionOperation.genericDistOrScalar,
~prior: option<t>, ~prior: option<t>,
~env: env ~env: env,
) => result<float, error> ) => 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 { switch values {
| [FRValueDist(a1), FRValueDist(a2)] => Ok(a1, a2) | [FRValueDist(a1), FRValueDist(a2)] => Ok(a1, a2)
| _ => Error(impossibleError) | _ => Error(impossibleError)
@ -95,8 +98,10 @@ module Prepare = {
let twoDistOrNumber = (values: ts): result<(frValueDistOrNumber, frValueDistOrNumber), err> => let twoDistOrNumber = (values: ts): result<(frValueDistOrNumber, frValueDistOrNumber), err> =>
values->ToValueArray.Record.twoArgs->E.R.bind(twoDistOrNumber) values->ToValueArray.Record.twoArgs->E.R.bind(twoDistOrNumber)
let twoDist = (values: ts): result<(DistributionTypes.genericDist, DistributionTypes.genericDist), err> => let twoDist = (values: ts): result<
values->ToValueArray.Record.twoArgs->E.R.bind(twoDist) (DistributionTypes.genericDist, DistributionTypes.genericDist),
err,
> => values->ToValueArray.Record.twoArgs->E.R.bind(twoDist)
} }
} }
@ -144,8 +149,7 @@ module Prepare = {
module Process = { module Process = {
module DistOrNumberToDist = { module DistOrNumberToDist = {
module Helpers = { module Helpers = {
let toSampleSet = (r, env: GenericDist.env) => let toSampleSet = (r, env: GenericDist.env) => GenericDist.toSampleSetDist(r, env.sampleCount)
GenericDist.toSampleSetDist(r, env.sampleCount)
let mapFnResult = r => let mapFnResult = r =>
switch r { switch r {