From 19ddd4eb3ffa938f829cae0acedb55466b90bd5f Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Sun, 4 Sep 2022 15:09:09 +0200 Subject: [PATCH] tweak: Add TwoNumbersToNumber wrapper to function registry. --- .../rescript/FunctionRegistry/Library/FR_Number.res | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res index 472ae60b..48fdc67f 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/Library/FR_Number.res @@ -20,6 +20,18 @@ module NumberToNumber = { ) } +module TwoNumbersToNumber = { + let make = (name, fn) => + FnDefinition.make( + ~name, + ~inputs=[FRTypeNumber, FRTypeNumber], + ~run=(_, inputs, _, _) => { + inputs->Prepare.ToValueTuple.twoNumbers->E.R2.fmap(fn)->E.R2.fmap(Wrappers.evNumber) + }, + (), + ) +} + module ArrayNumberDist = { let make = (name, fn) => { FnDefinition.make(