From 7e4477aeda4f9e4b169f72cd300e7a5648800031 Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Mon, 25 Apr 2022 10:00:27 -0400 Subject: [PATCH 1/2] Format Reducer code Value: [0.0000001 to 0.0005] --- packages/squiggle-lang/src/js/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/squiggle-lang/src/js/index.ts b/packages/squiggle-lang/src/js/index.ts index c8731b0f..ded1581e 100644 --- a/packages/squiggle-lang/src/js/index.ts +++ b/packages/squiggle-lang/src/js/index.ts @@ -81,7 +81,9 @@ function tag(x: a, y: b): tagged { return { tag: x, value: y }; } -export abstract class internalCode { protected opaque!: any }; /* simulate opaque types */ +export abstract class internalCode { + protected opaque!: any; +} /* simulate opaque types */ export type squiggleExpression = | tagged<"symbol", string> From d60aaa57f7333c6e04f468ef102b34293586ecc5 Mon Sep 17 00:00:00 2001 From: Sam Nolan Date: Mon, 25 Apr 2022 10:10:07 -0400 Subject: [PATCH 2/2] Get tests to pass for Reducer code Value: [0.0001 to 0.04] --- packages/squiggle-lang/src/js/index.ts | 5 +---- packages/squiggle-lang/src/rescript/TypescriptInterface.res | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/squiggle-lang/src/js/index.ts b/packages/squiggle-lang/src/js/index.ts index ded1581e..bed78695 100644 --- a/packages/squiggle-lang/src/js/index.ts +++ b/packages/squiggle-lang/src/js/index.ts @@ -10,6 +10,7 @@ import { continuousShape, discreteShape, distributionErrorToString, + internalCode, } from "../rescript/TypescriptInterface.gen"; export { makeSampleSetDist, @@ -81,10 +82,6 @@ function tag(x: a, y: b): tagged { return { tag: x, value: y }; } -export abstract class internalCode { - protected opaque!: any; -} /* simulate opaque types */ - export type squiggleExpression = | tagged<"symbol", string> | tagged<"string", string> diff --git a/packages/squiggle-lang/src/rescript/TypescriptInterface.res b/packages/squiggle-lang/src/rescript/TypescriptInterface.res index 8704bf5e..e200fbea 100644 --- a/packages/squiggle-lang/src/rescript/TypescriptInterface.res +++ b/packages/squiggle-lang/src/rescript/TypescriptInterface.res @@ -54,3 +54,6 @@ let errorValueToString = Reducer_ErrorValue.errorToString @genType let distributionErrorToString = DistributionTypes.Error.toString + +@genType +type internalCode = ReducerInterface_ExpressionValue.internalCode