diff --git a/packages/squiggle-lang/src/rescript/Distributions/DistributionTypes.res b/packages/squiggle-lang/src/rescript/Distributions/DistributionTypes.res index 0c119ea4..ab272c7f 100644 --- a/packages/squiggle-lang/src/rescript/Distributions/DistributionTypes.res +++ b/packages/squiggle-lang/src/rescript/Distributions/DistributionTypes.res @@ -6,7 +6,6 @@ type genericDist = type asAlgebraicCombinationStrategy = AsDefault | AsSymbolic | AsMonteCarlo | AsConvolution -@genType type error = | NotYetImplemented | Unreachable @@ -27,7 +26,6 @@ module Error = { let fromString = (s: string): t => OtherError(s) - @genType let toString = (err: error): string => switch err { | NotYetImplemented => "Function not yet implemented" diff --git a/packages/squiggle-lang/src/rescript/ForTS/ForTS__Types.res b/packages/squiggle-lang/src/rescript/ForTS/ForTS__Types.res index c382576d..f3041750 100644 --- a/packages/squiggle-lang/src/rescript/ForTS/ForTS__Types.res +++ b/packages/squiggle-lang/src/rescript/ForTS/ForTS__Types.res @@ -18,10 +18,14 @@ type squiggleValue_Declaration = ReducerInterface_InternalExpressionValue.lambda @genType.opaque type reducerProject = ReducerProject_T.t +/* Distribution related */ +@genType type environment = GenericDist.env +@genType.opaque +type distributionError = DistributionTypes.error + // From now on one should introduce any new types as opaque types. // Exception: The intended type is really a JavaScript type or record. Not by coincidence // Already existing open types we cannot dive in now -@genType type environment = GenericDist.env @genType type squiggleValue_Distribution = DistributionTypes.genericDist //TODO: index.ts should use types from here or vice versa diff --git a/packages/squiggle-lang/src/rescript/ForTS/ForTS__Functions.res b/packages/squiggle-lang/src/rescript/ForTS/For_TS_Distributions/For_TS_Distributions.res similarity index 66% rename from packages/squiggle-lang/src/rescript/ForTS/ForTS__Functions.res rename to packages/squiggle-lang/src/rescript/ForTS/For_TS_Distributions/For_TS_Distributions.res index 6a22297a..9e01f4e1 100644 --- a/packages/squiggle-lang/src/rescript/ForTS/ForTS__Functions.res +++ b/packages/squiggle-lang/src/rescript/ForTS/For_TS_Distributions/For_TS_Distributions.res @@ -1,6 +1,4 @@ open ForTS__Types -/* -Global variables, functions, helpers, etc. -*/ + @genType let defaultEnvironment: environment = DistributionOperation.defaultEnv diff --git a/packages/squiggle-lang/src/rescript/ForTS/For_TS_Distributions/For_TS_Distributions_Error.res b/packages/squiggle-lang/src/rescript/ForTS/For_TS_Distributions/For_TS_Distributions_Error.res new file mode 100644 index 00000000..fff8f232 --- /dev/null +++ b/packages/squiggle-lang/src/rescript/ForTS/For_TS_Distributions/For_TS_Distributions_Error.res @@ -0,0 +1,4 @@ +open ForTS__Types + +@genType +let toString = (e: distributionError) => DistributionTypes.Error.toString(e) diff --git a/packages/squiggle-lang/src/rescript/TypescriptInterface.res b/packages/squiggle-lang/src/rescript/TypescriptInterface.res index f096b233..60ed0ad6 100644 --- a/packages/squiggle-lang/src/rescript/TypescriptInterface.res +++ b/packages/squiggle-lang/src/rescript/TypescriptInterface.res @@ -20,9 +20,6 @@ type sampleSetDist = SampleSetDist.t @genType type symbolicDist = SymbolicDistTypes.symbolicDist -@genType -type distributionError = DistributionTypes.error - @genType type resultDist = result_ @@ -58,8 +55,9 @@ type discreteShape = PointSetTypes.discreteShape @genType type continuousShape = PointSetTypes.continuousShape -@genType -let distributionErrorToString = DistributionTypes.Error.toString +// ForTS_Distributions_Error.toString +// @genType +// let distributionErrorToString = DistributionTypes.Error.toString @genType let defaultSamplingEnv = DistributionOperation.defaultEnv