diff --git a/src/utility/lib/CDFunctor.re b/src/utility/lib/CDFunctor.re new file mode 100644 index 00000000..c6b823dd --- /dev/null +++ b/src/utility/lib/CDFunctor.re @@ -0,0 +1,7 @@ +module type Config = {let shape: DistributionTypes.xyShape;}; + +module Make = (Config: Config) => { + let validateHasLength = (): bool => Array.length(Config.shape.xs) > 0; + let validateSize = (): bool => + Array.length(Config.shape.xs) == Array.length(Config.shape.ys); +}; diff --git a/src/utility/lib/CDFunctor__Test.re b/src/utility/lib/CDFunctor__Test.re new file mode 100644 index 00000000..e6399a8f --- /dev/null +++ b/src/utility/lib/CDFunctor__Test.re @@ -0,0 +1,8 @@ +module CDFConfig = { + let shape: DistributionTypes.xyShape = { + xs: [|1., 4., 8.|], + ys: [|8., 9., 2.|], + }; +}; + +module CDF = CDFunctor.Make(CDFConfig);