2022-05-19 22:24:56 +00:00
|
|
|
open FunctionRegistry_Core
|
|
|
|
open FunctionRegistry_Helpers
|
|
|
|
|
2022-05-21 15:41:12 +00:00
|
|
|
let twoArgs = E.Tuple2.toFnCall
|
2022-05-19 22:24:56 +00:00
|
|
|
|
2022-05-24 00:49:10 +00:00
|
|
|
// ~run=(inputs, env) => switch(inputs->FunctionRegistry_Helpers.Prepare.ToValueArray.Record.twoArgs){
|
|
|
|
// | (FRTypeArray(records), FRValueLambdaValue(fn)) => {
|
|
|
|
// records->E.A.fmap2(r => r->FunctionRegistry_Helpers.Prepare.ToValueArray.Record.twoArgs->FunctionRegistry_Helpers.Prepare)
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
// let variant = FRTypeVariant(["Numeric", "Date"])
|
|
|
|
let recordType = FRTypeRecord([("min", FRTypeNumber), ("max", FRTypeNumber)])
|
2022-05-22 14:38:17 +00:00
|
|
|
let registry = [
|
2022-05-24 00:49:10 +00:00
|
|
|
Function.make(
|
|
|
|
~name="FnMake",
|
|
|
|
~definitions=[
|
|
|
|
FnDefinition.make(
|
|
|
|
~name="declareFn",
|
|
|
|
~inputs=[FRTypeRecord([("inputs", FRTypeArray(recordType))])],
|
|
|
|
~run=(inputs, _) => {
|
|
|
|
let foo = FunctionRegistry_Core.FRType.matchReverse(inputs->E.A.unsafe_get(0))
|
|
|
|
foo->Ok
|
|
|
|
}
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
2022-05-22 14:38:17 +00:00
|
|
|
Function.make(
|
2022-05-19 22:24:56 +00:00
|
|
|
~name="Normal",
|
|
|
|
~definitions=[
|
2022-05-22 14:38:17 +00:00
|
|
|
TwoArgDist.make("normal", twoArgs(SymbolicDist.Normal.make)),
|
2022-05-23 18:28:32 +00:00
|
|
|
TwoArgDist.makeRecordP5P95("normal", r =>
|
|
|
|
twoArgs(SymbolicDist.Normal.from90PercentCI, r)->Ok
|
|
|
|
),
|
2022-05-22 14:38:17 +00:00
|
|
|
TwoArgDist.makeRecordMeanStdev("normal", twoArgs(SymbolicDist.Normal.make)),
|
2022-05-19 22:24:56 +00:00
|
|
|
],
|
2022-05-22 14:38:17 +00:00
|
|
|
),
|
|
|
|
Function.make(
|
2022-05-19 22:24:56 +00:00
|
|
|
~name="Lognormal",
|
|
|
|
~definitions=[
|
2022-05-22 14:38:17 +00:00
|
|
|
TwoArgDist.make("lognormal", twoArgs(SymbolicDist.Lognormal.make)),
|
|
|
|
TwoArgDist.makeRecordP5P95("lognormal", r =>
|
|
|
|
twoArgs(SymbolicDist.Lognormal.from90PercentCI, r)->Ok
|
|
|
|
),
|
|
|
|
TwoArgDist.makeRecordMeanStdev("lognormal", twoArgs(SymbolicDist.Lognormal.fromMeanAndStdev)),
|
2022-05-19 22:24:56 +00:00
|
|
|
],
|
2022-05-22 14:38:17 +00:00
|
|
|
),
|
2022-05-20 21:36:40 +00:00
|
|
|
Function.make(
|
|
|
|
~name="Uniform",
|
2022-05-22 14:38:17 +00:00
|
|
|
~definitions=[TwoArgDist.make("uniform", twoArgs(SymbolicDist.Uniform.make))],
|
2022-05-20 21:36:40 +00:00
|
|
|
),
|
|
|
|
Function.make(
|
|
|
|
~name="Beta",
|
2022-05-22 14:38:17 +00:00
|
|
|
~definitions=[TwoArgDist.make("beta", twoArgs(SymbolicDist.Beta.make))],
|
2022-05-20 21:36:40 +00:00
|
|
|
),
|
|
|
|
Function.make(
|
|
|
|
~name="Cauchy",
|
2022-05-22 14:38:17 +00:00
|
|
|
~definitions=[TwoArgDist.make("cauchy", twoArgs(SymbolicDist.Cauchy.make))],
|
2022-05-20 21:36:40 +00:00
|
|
|
),
|
|
|
|
Function.make(
|
|
|
|
~name="Gamma",
|
2022-05-22 14:38:17 +00:00
|
|
|
~definitions=[TwoArgDist.make("gamma", twoArgs(SymbolicDist.Gamma.make))],
|
2022-05-20 21:36:40 +00:00
|
|
|
),
|
|
|
|
Function.make(
|
|
|
|
~name="Logistic",
|
2022-05-22 14:38:17 +00:00
|
|
|
~definitions=[TwoArgDist.make("logistic", twoArgs(SymbolicDist.Logistic.make))],
|
2022-05-20 21:36:40 +00:00
|
|
|
),
|
|
|
|
Function.make(
|
|
|
|
~name="To",
|
2022-05-23 18:28:32 +00:00
|
|
|
~definitions=[
|
|
|
|
TwoArgDist.make("to", twoArgs(SymbolicDist.From90thPercentile.make)),
|
|
|
|
TwoArgDist.make(
|
|
|
|
"credibleIntervalToDistribution",
|
|
|
|
twoArgs(SymbolicDist.From90thPercentile.make),
|
|
|
|
),
|
2022-05-23 17:49:39 +00:00
|
|
|
],
|
2022-05-23 18:28:32 +00:00
|
|
|
),
|
|
|
|
Function.make(
|
|
|
|
~name="Exponential",
|
|
|
|
~definitions=[OneArgDist.make("exponential", SymbolicDist.Exponential.make)],
|
|
|
|
),
|
|
|
|
Function.make(
|
|
|
|
~name="Bernoulli",
|
|
|
|
~definitions=[OneArgDist.make("bernoulli", SymbolicDist.Bernoulli.make)],
|
2022-05-21 02:54:15 +00:00
|
|
|
),
|
2022-05-20 21:36:40 +00:00
|
|
|
]
|