tweak: Add skeleton for calculating dimishing returns allocation

This commit is contained in:
NunoSempere 2022-09-05 14:00:14 +02:00
parent f370c44771
commit aa3173f85b

View File

@ -168,7 +168,16 @@ module Internals = {
} }
result result
} }
@dead let getDiminishingMarginalReturnsEquilibrium = "To do" let diminishingMarginalReturnsSkeleton = (
lambda1,
lambda2,
funds,
increment,
environment,
reducer,
) => {
Ok(castFloatToInternalNumber(0.0))
}
} }
let library = [ let library = [
@ -343,4 +352,25 @@ let library = [
], ],
(), (),
), ),
Function.make(
~name="diminishingMarginalReturnsSkeleton",
~nameSpace,
~output=EvtNumber,
~requiresNamespace=false,
~examples=[`Danger.diminishingMarginalReturnsSkeleton({|x| x+1}, {|y| 10}, 100, 1)`],
~definitions=[
FnDefinition.make(
~name="diminishingMarginalReturnsSkeleton",
~inputs=[FRTypeLambda, FRTypeLambda, FRTypeNumber, FRTypeNumber],
~run=(inputs, _, env, reducer) =>
switch inputs {
| [IEvLambda(lambda1), IEvLambda(lambda2), IEvNumber(funds), IEvNumber(increment)] =>
Internals.diminishingMarginalReturnsSkeleton(lambda1, lambda2, funds, increment, env, reducer)
| _ => Error("Error in Danger.diminishingMarginalReturnsSkeleton")
},
(),
),
],
(),
),
] ]