diff --git a/packages/playground/bsconfig.json b/packages/playground/bsconfig.json index 4cc7b140..aa5de425 100644 --- a/packages/playground/bsconfig.json +++ b/packages/playground/bsconfig.json @@ -39,7 +39,7 @@ "@rescript/react", "bs-css", "bs-css-emotion", - "@foretold-app/squiggle", + "@squiggle/lang", "rationale", "bs-moment", "reschema" diff --git a/packages/playground/docs/index.html b/packages/playground/docs/index.html index 030bd7fb..b534bc13 100644 --- a/packages/playground/docs/index.html +++ b/packages/playground/docs/index.html @@ -13,7 +13,7 @@ diff --git a/packages/playground/package.json b/packages/playground/package.json index 47b01fa8..c02877fc 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -1,5 +1,5 @@ { - "name": "@foretold-app/squiggle-playground", + "name": "@squiggle/playground", "version": "0.1.0", "homepage": "https://foretold-app.github.io/estiband/", "scripts": { @@ -61,7 +61,7 @@ "react-vega": "^7.4.4", "reschema": "^2.2.0", "rescript": "^9.1.4", - "@foretold-app/squiggle": "^0.1.9", + "@squiggle/lang": "^0.1.9", "tailwindcss": "1.2.0", "vega": "*", "vega-embed": "6.6.0", diff --git a/packages/playground/src/components/DistBuilder.res b/packages/playground/src/components/DistBuilder.res index 3cb0a243..7dff0fd3 100644 --- a/packages/playground/src/components/DistBuilder.res +++ b/packages/playground/src/components/DistBuilder.res @@ -100,7 +100,7 @@ module DemoDist = {
{switch options { | Some(options) => - let inputs1 = ForetoldAppSquiggle.ProgramEvaluator.Inputs.make( + let inputs1 = SquiggleLang.ProgramEvaluator.Inputs.make( ~samplingInputs={ sampleCount: Some(options.sampleCount), outputXYPoints: Some(options.outputXYPoints), @@ -117,15 +117,15 @@ module DemoDist = { (), ) - let distributionList = ForetoldAppSquiggle.ProgramEvaluator.evaluateProgram(inputs1) + let distributionList = SquiggleLang.ProgramEvaluator.evaluateProgram(inputs1) let renderExpression = response1 => switch response1 { - | #DistPlus(distPlus1) => + | #DistPlus(distPlus1) => | #Float(f) => | #Function((f, a), env) => // Problem: When it gets the function, it doesn't save state about previous commands - let foo: ForetoldAppSquiggle.ProgramEvaluator.Inputs.inputs = { + let foo: SquiggleLang.ProgramEvaluator.Inputs.inputs = { squiggleString: squiggleString, samplingInputs: inputs1.samplingInputs, environment: env, @@ -133,13 +133,13 @@ module DemoDist = { let results = E.A.Floats.range(options.diagramStart, options.diagramStop, options.diagramCount) |> E.A.fmap(r => - ForetoldAppSquiggle.ProgramEvaluator.evaluateFunction( + SquiggleLang.ProgramEvaluator.evaluateFunction( foo, (f, a), [#SymbolicDist(#Float(r))], ) |> E.R.bind(_, a => switch a { - | #DistPlus(d) => Ok((r, ForetoldAppSquiggle.DistPlus.T.normalize(d))) + | #DistPlus(d) => Ok((r, SquiggleLang.DistPlus.T.normalize(d))) | n => Js.log2("Error here", n) Error("wrong type") diff --git a/packages/playground/src/components/charts/DistPlusPlot.res b/packages/playground/src/components/charts/DistPlusPlot.res index ecae087e..6e00cc40 100644 --- a/packages/playground/src/components/charts/DistPlusPlot.res +++ b/packages/playground/src/components/charts/DistPlusPlot.res @@ -1,7 +1,7 @@ open DistPlusPlotReducer let plotBlue = #hex("1860ad") -let showAsForm = (distPlus: ForetoldAppSquiggle.PointSetTypes.distPlus) => +let showAsForm = (distPlus: SquiggleLang.PointSetTypes.distPlus) =>
E.O.default("")} />
let showFloat = (~precision=3, number) => @@ -23,27 +23,27 @@ let table = (distPlus, x) => {x |> E.Float.toString |> React.string} {distPlus - |> ForetoldAppSquiggle.DistPlus.T.xToY(x) - |> ForetoldAppSquiggle.PointSetTypes.MixedPoint.toDiscreteValue + |> SquiggleLang.DistPlus.T.xToY(x) + |> SquiggleLang.PointSetTypes.MixedPoint.toDiscreteValue |> Js.Float.toPrecisionWithPrecision(_, ~digits=7) |> React.string} {distPlus - |> ForetoldAppSquiggle.DistPlus.T.xToY(x) - |> ForetoldAppSquiggle.PointSetTypes.MixedPoint.toContinuousValue + |> SquiggleLang.DistPlus.T.xToY(x) + |> SquiggleLang.PointSetTypes.MixedPoint.toContinuousValue |> Js.Float.toPrecisionWithPrecision(_, ~digits=7) |> React.string} {distPlus - |> ForetoldAppSquiggle.DistPlus.T.Integral.xToY(x) + |> SquiggleLang.DistPlus.T.Integral.xToY(x) |> E.Float.with2DigitsPrecision |> React.string} {distPlus - |> ForetoldAppSquiggle.DistPlus.T.Integral.sum + |> SquiggleLang.DistPlus.T.Integral.sum |> E.Float.with2DigitsPrecision |> React.string} @@ -61,16 +61,16 @@ let table = (distPlus, x) => {distPlus - |> ForetoldAppSquiggle.DistPlus.T.toContinuous - |> E.O.fmap(ForetoldAppSquiggle.Continuous.T.Integral.sum) + |> SquiggleLang.DistPlus.T.toContinuous + |> E.O.fmap(SquiggleLang.Continuous.T.Integral.sum) |> E.O.fmap(E.Float.with2DigitsPrecision) |> E.O.default("") |> React.string} {distPlus - |> ForetoldAppSquiggle.DistPlus.T.toDiscrete - |> E.O.fmap(ForetoldAppSquiggle.Discrete.T.Integral.sum) + |> SquiggleLang.DistPlus.T.toDiscrete + |> E.O.fmap(SquiggleLang.Discrete.T.Integral.sum) |> E.O.fmap(E.Float.with2DigitsPrecision) |> E.O.default("") |> React.string} @@ -97,28 +97,28 @@ let percentiles = distPlus => - {distPlus |> ForetoldAppSquiggle.DistPlus.T.Integral.yToX(0.01) |> showFloat} + {distPlus |> SquiggleLang.DistPlus.T.Integral.yToX(0.01) |> showFloat} - {distPlus |> ForetoldAppSquiggle.DistPlus.T.Integral.yToX(0.05) |> showFloat} + {distPlus |> SquiggleLang.DistPlus.T.Integral.yToX(0.05) |> showFloat} - {distPlus |> ForetoldAppSquiggle.DistPlus.T.Integral.yToX(0.25) |> showFloat} + {distPlus |> SquiggleLang.DistPlus.T.Integral.yToX(0.25) |> showFloat} - {distPlus |> ForetoldAppSquiggle.DistPlus.T.Integral.yToX(0.5) |> showFloat} + {distPlus |> SquiggleLang.DistPlus.T.Integral.yToX(0.5) |> showFloat} - {distPlus |> ForetoldAppSquiggle.DistPlus.T.Integral.yToX(0.75) |> showFloat} + {distPlus |> SquiggleLang.DistPlus.T.Integral.yToX(0.75) |> showFloat} - {distPlus |> ForetoldAppSquiggle.DistPlus.T.Integral.yToX(0.95) |> showFloat} + {distPlus |> SquiggleLang.DistPlus.T.Integral.yToX(0.95) |> showFloat} - {distPlus |> ForetoldAppSquiggle.DistPlus.T.Integral.yToX(0.99) |> showFloat} + {distPlus |> SquiggleLang.DistPlus.T.Integral.yToX(0.99) |> showFloat} - {distPlus |> ForetoldAppSquiggle.DistPlus.T.Integral.yToX(0.99999) |> showFloat} + {distPlus |> SquiggleLang.DistPlus.T.Integral.yToX(0.99999) |> showFloat} @@ -133,11 +133,11 @@ let percentiles = distPlus => - {distPlus |> ForetoldAppSquiggle.DistPlus.T.mean |> showFloat} + {distPlus |> SquiggleLang.DistPlus.T.mean |> showFloat} - {distPlus |> ForetoldAppSquiggle.DistPlus.T.variance |> (r => r ** 0.5) |> showFloat} + {distPlus |> SquiggleLang.DistPlus.T.variance |> (r => r ** 0.5) |> showFloat} - {distPlus |> ForetoldAppSquiggle.DistPlus.T.variance |> showFloat} + {distPlus |> SquiggleLang.DistPlus.T.variance |> showFloat} @@ -155,11 +155,11 @@ let adjustBoth = discreteProbabilityMassFraction => { module DistPlusChart = { @react.component - let make = (~distPlus: ForetoldAppSquiggle.PointSetTypes.distPlus, ~config: chartConfig, ~onHover) => { - open ForetoldAppSquiggle.DistPlus + let make = (~distPlus: SquiggleLang.PointSetTypes.distPlus, ~config: chartConfig, ~onHover) => { + open SquiggleLang.DistPlus - let discrete = distPlus |> T.toDiscrete |> E.O.fmap(ForetoldAppSquiggle.Discrete.getShape) - let continuous = distPlus |> T.toContinuous |> E.O.fmap(ForetoldAppSquiggle.Continuous.getShape) + let discrete = distPlus |> T.toDiscrete |> E.O.fmap(SquiggleLang.Discrete.getShape) + let continuous = distPlus |> T.toContinuous |> E.O.fmap(SquiggleLang.Continuous.getShape) // // We subtract a bit from the range to make sure that it fits. Maybe this should be done in d3 instead. // let minX = @@ -176,7 +176,7 @@ module DistPlusChart = { let maxX = distPlus |> T.Integral.yToX(0.99999) - let timeScale = distPlus.unit |> ForetoldAppSquiggle.PointSetTypes.DistributionUnit.toJson + let timeScale = distPlus.unit |> SquiggleLang.PointSetTypes.DistributionUnit.toJson let discreteProbabilityMassFraction = distPlus |> T.toDiscreteProbabilityMassFraction let (yMaxDiscreteDomainFactor, yMaxContinuousDomainFactor) = adjustBoth( @@ -202,13 +202,13 @@ module DistPlusChart = { module IntegralChart = { @react.component - let make = (~distPlus: ForetoldAppSquiggle.PointSetTypes.distPlus, ~config: chartConfig, ~onHover) => { + let make = (~distPlus: SquiggleLang.PointSetTypes.distPlus, ~config: chartConfig, ~onHover) => { let integral = distPlus.integralCache - let continuous = integral |> ForetoldAppSquiggle.Continuous.toLinear |> E.O.fmap(ForetoldAppSquiggle.Continuous.getShape) - let minX = distPlus |> ForetoldAppSquiggle.DistPlus.T.Integral.yToX(0.00001) + let continuous = integral |> SquiggleLang.Continuous.toLinear |> E.O.fmap(SquiggleLang.Continuous.getShape) + let minX = distPlus |> SquiggleLang.DistPlus.T.Integral.yToX(0.00001) - let maxX = distPlus |> ForetoldAppSquiggle.DistPlus.T.Integral.yToX(0.99999) - let timeScale = distPlus.unit |> ForetoldAppSquiggle.PointSetTypes.DistributionUnit.toJson + let maxX = distPlus |> SquiggleLang.DistPlus.T.Integral.yToX(0.99999) + let timeScale = distPlus.unit |> SquiggleLang.PointSetTypes.DistributionUnit.toJson { + let make = (~distPlus: SquiggleLang.PointSetTypes.distPlus, ~config: chartConfig, ~onHover) => { let chart = React.useMemo2( () => config.isCumulative @@ -246,7 +246,7 @@ module Chart = { let button = "bg-gray-300 hover:bg-gray-500 text-grey-darkest text-xs px-4 py-1" @react.component -let make = (~distPlus: ForetoldAppSquiggle.PointSetTypes.distPlus) => { +let make = (~distPlus: SquiggleLang.PointSetTypes.distPlus) => { let (x, setX) = React.useState(() => 0.) let (state, dispatch) = React.useReducer(DistPlusPlotReducer.reducer, DistPlusPlotReducer.init) diff --git a/packages/playground/src/components/charts/DistributionPlot/DistributionPlot.res b/packages/playground/src/components/charts/DistributionPlot/DistributionPlot.res index d8e2e105..08bbf179 100644 --- a/packages/playground/src/components/charts/DistributionPlot/DistributionPlot.res +++ b/packages/playground/src/components/charts/DistributionPlot/DistributionPlot.res @@ -95,12 +95,12 @@ let make = ( ?xScale ?yScale ?timeScale - discrete={discrete |> E.O.fmap(ForetoldAppSquiggle.XYShape.T.toJs)} + discrete={discrete |> E.O.fmap(SquiggleLang.XYShape.T.toJs)} height marginBottom=50 marginTop=0 onHover - continuous={continuous |> E.O.fmap(ForetoldAppSquiggle.XYShape.T.toJs)} + continuous={continuous |> E.O.fmap(SquiggleLang.XYShape.T.toJs)} showDistributionLines showDistributionYAxis showVerticalLine diff --git a/packages/playground/src/components/charts/DistributionPlot/PercentilesChart.res b/packages/playground/src/components/charts/DistributionPlot/PercentilesChart.res index 18baaea7..af772c99 100644 --- a/packages/playground/src/components/charts/DistributionPlot/PercentilesChart.res +++ b/packages/playground/src/components/charts/DistributionPlot/PercentilesChart.res @@ -1,4 +1,4 @@ -open ForetoldAppSquiggle +open SquiggleLang @module("./PercentilesChart.js") external percentilesChart: React.element = "PercentilesChart" diff --git a/packages/squiggle-lang/bsconfig.json b/packages/squiggle-lang/bsconfig.json index 5425d2a7..a5ff96ea 100644 --- a/packages/squiggle-lang/bsconfig.json +++ b/packages/squiggle-lang/bsconfig.json @@ -1,5 +1,5 @@ { - "name": "@foretold-app/squiggle", + "name": "@squiggle/lang", "reason": {}, "sources": [ { diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index 9d76bb76..0a652f9f 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -1,5 +1,5 @@ { - "name": "@foretold-app/squiggle", + "name": "@squiggle/lang", "version": "0.1.9", "homepage": "https://foretold-app.github.io/estiband/", "private": false,