diff --git a/src/EAFunds.bs.js b/src/EAFunds.bs.js new file mode 100644 index 00000000..d34b90ba --- /dev/null +++ b/src/EAFunds.bs.js @@ -0,0 +1,36 @@ +'use strict'; + + +function yearlyMeanGrowthRateIfNotClosed(group) { + return { + meanDiff: 1.1, + stdDiff: 1.1 + }; +} + +function yearlyChanceOfClosing(group) { + return 0.1; +} + +function yearlyStdevGrowthRate(group, year, parameter) { + if (group) { + return /* tuple */[ + 30, + 30 + ]; + } else { + return /* tuple */[ + 50, + 10 + ]; + } +} + +var PayoutsIfAround = { + yearlyMeanGrowthRateIfNotClosed: yearlyMeanGrowthRateIfNotClosed, + yearlyChanceOfClosing: yearlyChanceOfClosing, + yearlyStdevGrowthRate: yearlyStdevGrowthRate +}; + +exports.PayoutsIfAround = PayoutsIfAround; +/* No side effect */ diff --git a/src/EAFunds.re b/src/EAFunds.re new file mode 100644 index 00000000..d72ae583 --- /dev/null +++ b/src/EAFunds.re @@ -0,0 +1,39 @@ +type fund = + | ANIMAL_WELFARE + | GLOBAL_HEALTH + | LONG_TERM_FUTURE + | META; + +type group = + | Fund(fund) + | All; + +type parameter = + | CHANCE_CLOSED + | DONATIONS + | PAYOUTS; + +type yearlyNumericDiff = { + meanDiff: float, + stdDiff: float, +}; + +module PayoutsIfAround = { + let yearlyMeanGrowthRateIfNotClosed = (group: group): yearlyNumericDiff => { + {meanDiff: 1.1, stdDiff: 1.1}; + }; + + let yearlyChanceOfClosing = (group: group) => { + 0.1; + }; + + let yearlyStdevGrowthRate = (group: group, year: int, parameter: parameter) => { + switch (group) { + | Fund(ANIMAL_WELFARE) => (30, 30) + | Fund(GLOBAL_HEALTH) => (30, 30) + | Fund(LONG_TERM_FUTURE) => (30, 30) + | Fund(META) => (30, 30) + | All => (50, 10) + }; + }; +}; \ No newline at end of file