From 10de355f86330eb48a4a8a0c1878e5a4064d7538 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Fri, 3 Jun 2022 17:59:02 -0700 Subject: [PATCH 01/20] First attempt at auto-documentation --- .../FunctionRegistry_Core.res | 31 ++- .../FunctionRegistry_Library.res | 124 +++++++---- packages/website/docs/Features/Api.md | 199 ++++++++++++++++++ 3 files changed, 315 insertions(+), 39 deletions(-) create mode 100644 packages/website/docs/Features/Api.md diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index eed48ffc..b3e0c310 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -42,6 +42,9 @@ type fnDefinition = { type function = { name: string, definitions: array, + examples: option, + description: option, + isExperimental: bool, } type registry = array @@ -55,9 +58,9 @@ module FRType = { | FRTypeDistOrNumber => "frValueDistOrNumber" | FRTypeRecord(r) => { let input = ((name, frType): frTypeRecordParam) => `${name}: ${toString(frType)}` - `record({${r->E.A2.fmap(input)->E.A2.joinWith(", ")}})` + `{${r->E.A2.fmap(input)->E.A2.joinWith(", ")}}` } - | FRTypeArray(r) => `record(${toString(r)})` + | FRTypeArray(r) => `array<${toString(r)}>` | FRTypeLambda => `lambda` | FRTypeString => `string` | FRTypeVariant(_) => "variant" @@ -291,13 +294,34 @@ module FnDefinition = { module Function = { type t = function - let make = (~name, ~definitions): t => { + type functionJson = { + name: string, + definitions: array, + examples: option, + description: option, + isExperimental: bool, + } + + let make = (~name, ~definitions, ~examples=?, ~description=?, ~isExperimental=false, ()): t => { name: name, definitions: definitions, + examples: examples, + isExperimental: isExperimental, + description: description, + } + + let toSimple = (t: t): functionJson => { + name: t.name, + definitions: t.definitions->E.A2.fmap(FnDefinition.toString), + examples: t.examples, + description: t.description, + isExperimental: t.isExperimental, } } module Registry = { + let toSimple = (r: registry) => r->E.A2.fmap(Function.toSimple) + /* There's a (potential+minor) bug here: If a function definition is called outside of the calls to the registry, then it's possible that there could be a match after the registry is @@ -310,6 +334,7 @@ module Registry = { ~env: DistributionOperation.env, ) => { let matchToDef = m => Matcher.Registry.matchToDef(registry, m) + Js.log(toSimple(registry)) let showNameMatchDefinitions = matches => { let defs = matches diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index 6230f828..011e8b13 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -49,35 +49,10 @@ let inputsTodist = (inputs: array, makeDist) => { let registry = [ Function.make( - ~name="toContinuousPointSet", - ~definitions=[ - FnDefinition.make( - ~name="toContinuousPointSet", - ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], - ~run=(inputs, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), - ), - ], - ), - Function.make( - ~name="toDiscretePointSet", - ~definitions=[ - FnDefinition.make( - ~name="toDiscretePointSet", - ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], - ~run=(inputs, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), - ), - ], - ), - Function.make( - ~name="Declaration", - ~definitions=[ - FnDefinition.make(~name="declareFn", ~inputs=[Declaration.frType], ~run=(inputs, _) => { - inputs->E.A.unsafe_get(0)->Declaration.fromExpressionValue - }), - ], - ), - Function.make( - ~name="Normal", + ~name="Normal Distribution", + ~examples=`normal(5,1) +normal({p5: 4, p95: 10}) +normal({mean: 5, stdev: 2})`, ~definitions=[ TwoArgDist.make("normal", twoArgs(SymbolicDist.Normal.make)), TwoArgDist.makeRecordP5P95("normal", r => @@ -85,9 +60,13 @@ let registry = [ ), TwoArgDist.makeRecordMeanStdev("normal", twoArgs(SymbolicDist.Normal.make)), ], + (), ), Function.make( - ~name="Lognormal", + ~name="Lognormal Distribution", + ~examples=`lognormal(0.5, 0.8) +lognormal({p5: 4, p95: 10}) +lognormal({mean: 5, stdev: 2})`, ~definitions=[ TwoArgDist.make("lognormal", twoArgs(SymbolicDist.Lognormal.make)), TwoArgDist.makeRecordP5P95("lognormal", r => @@ -95,29 +74,43 @@ let registry = [ ), TwoArgDist.makeRecordMeanStdev("lognormal", twoArgs(SymbolicDist.Lognormal.fromMeanAndStdev)), ], + (), ), Function.make( - ~name="Uniform", + ~name="Uniform Distribution", + ~examples=`uniform(10, 12)`, ~definitions=[TwoArgDist.make("uniform", twoArgs(SymbolicDist.Uniform.make))], + (), ), Function.make( - ~name="Beta", + ~name="Beta Distribution", + ~examples=`beta(20, 25)`, ~definitions=[TwoArgDist.make("beta", twoArgs(SymbolicDist.Beta.make))], + (), ), Function.make( - ~name="Cauchy", + ~name="Cauchy Distribution", + ~examples=`cauchy(5, 1)`, ~definitions=[TwoArgDist.make("cauchy", twoArgs(SymbolicDist.Cauchy.make))], + (), ), Function.make( - ~name="Gamma", + ~name="Gamma Distribution", + ~examples=`gamma(5, 1)`, ~definitions=[TwoArgDist.make("gamma", twoArgs(SymbolicDist.Gamma.make))], + (), ), Function.make( - ~name="Logistic", + ~name="Logistic Distribution", + ~examples=`gamma(5, 1)`, ~definitions=[TwoArgDist.make("logistic", twoArgs(SymbolicDist.Logistic.make))], + (), ), Function.make( - ~name="To", + ~name="To (Distribution)", + ~examples=`5 to 10 +to(5,10) +-5 to 5`, ~definitions=[ TwoArgDist.make("to", twoArgs(SymbolicDist.From90thPercentile.make)), TwoArgDist.make( @@ -125,13 +118,72 @@ let registry = [ twoArgs(SymbolicDist.From90thPercentile.make), ), ], + (), ), Function.make( ~name="Exponential", + ~examples=`exponential(2)`, ~definitions=[OneArgDist.make("exponential", SymbolicDist.Exponential.make)], + (), ), Function.make( ~name="Bernoulli", + ~examples=`bernoulli(0.5)`, ~definitions=[OneArgDist.make("bernoulli", SymbolicDist.Bernoulli.make)], + (), + ), + Function.make( + ~name="toContinuousPointSet", + ~description="Converts a set of points to a continuous distribution", + ~examples=`toContinuousPointSet([ + {x: 0, y: 0.1}, + {x: 1, y: 0.2}, + {x: 2, y: 0.15}, + {x: 3, y: 0.1} +])`, + ~definitions=[ + FnDefinition.make( + ~name="toContinuousPointSet", + ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], + ~run=(inputs, _) => inputsTodist(inputs, r => Continuous(Continuous.make(r))), + ), + ], + (), + ), + Function.make( + ~name="toDiscretePointSet", + ~description="Converts a set of points to a discrete distribution", + ~examples=`toDiscretePointSet([ + {x: 0, y: 0.1}, + {x: 1, y: 0.2}, + {x: 2, y: 0.15}, + {x: 3, y: 0.1} +])`, + ~definitions=[ + FnDefinition.make( + ~name="toDiscretePointSet", + ~inputs=[FRTypeArray(FRTypeRecord([("x", FRTypeNumeric), ("y", FRTypeNumeric)]))], + ~run=(inputs, _) => inputsTodist(inputs, r => Discrete(Discrete.make(r))), + ), + ], + (), + ), + Function.make( + ~name="Declaration (Continuous Function)", + ~description="Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within.", + ~examples=`declareFn({ + fn: {|a,b| a }, + inputs: [ + {min: 0, max: 100}, + {min: 30, max: 50} + ] +})`, + ~definitions=[ + FnDefinition.make(~name="declareFn", ~inputs=[Declaration.frType], ~run=(inputs, _) => { + inputs->E.A.unsafe_get(0)->Declaration.fromExpressionValue + }), + ], + ~isExperimental=true, + (), ), ] diff --git a/packages/website/docs/Features/Api.md b/packages/website/docs/Features/Api.md new file mode 100644 index 00000000..4955d498 --- /dev/null +++ b/packages/website/docs/Features/Api.md @@ -0,0 +1,199 @@ +--- +sidebar_position: 5 +title: API +--- +## Normal Distribution + +**Definitions** +```javascript +normal(frValueDistOrNumber, frValueDistOrNumber) +``` +```javascript +normal(dict<{p5: frValueDistOrNumber, p95: frValueDistOrNumber}>) +``` +```javascript +normal(dict<{mean: frValueDistOrNumber, stdev: frValueDistOrNumber}>) +``` + +**Examples** +```javascript +normal(5,1) +normal({p5: 4, p95: 10}) +normal({mean: 5, stdev: 2}) +``` + +## Lognormal Distribution + +**Definitions** +```javascript +lognormal(frValueDistOrNumber, frValueDistOrNumber) +``` +```javascript +lognormal(dict<{p5: frValueDistOrNumber, p95: frValueDistOrNumber}>) +``` +```javascript +lognormal(dict<{mean: frValueDistOrNumber, stdev: frValueDistOrNumber}>) +``` + +**Examples** +```javascript +lognormal(0.5, 0.8) +lognormal({p5: 4, p95: 10}) +lognormal({mean: 5, stdev: 2}) +``` + +## Uniform Distribution + +**Definitions** +```javascript +uniform(frValueDistOrNumber, frValueDistOrNumber) +``` + +**Examples** +```javascript +uniform(10, 12) +``` + +## Beta Distribution + +**Definitions** +```javascript +beta(frValueDistOrNumber, frValueDistOrNumber) +``` + +**Examples** +```javascript +beta(20, 25) +``` + +## Cauchy Distribution + +**Definitions** +```javascript +cauchy(frValueDistOrNumber, frValueDistOrNumber) +``` + +**Examples** +```javascript +cauchy(5, 1) +``` + +## Gamma Distribution + +**Definitions** +```javascript +gamma(frValueDistOrNumber, frValueDistOrNumber) +``` + +**Examples** +```javascript +gamma(5, 1) +``` + +## Logistic Distribution + +**Definitions** +```javascript +logistic(frValueDistOrNumber, frValueDistOrNumber) +``` + +**Examples** +```javascript +gamma(5, 1) +``` + +## To (Distribution) + +**Definitions** +```javascript +to(frValueDistOrNumber, frValueDistOrNumber) +``` +```javascript +credibleIntervalToDistribution(frValueDistOrNumber, frValueDistOrNumber) +``` + +**Examples** +```javascript +5 to 10 +to(5,10) +-5 to 5 +``` + +## Exponential + +**Definitions** +```javascript +exponential(frValueDistOrNumber) +``` + +**Examples** +```javascript +exponential(2) +``` + +## Bernoulli + +**Definitions** +```javascript +bernoulli(frValueDistOrNumber) +``` + +**Examples** +```javascript +bernoulli(0.5) +``` + +## toContinuousPointSet +Converts a set of points to a continuous distribution + +**Definitions** +```javascript +toContinuousPointSet(array>) +``` + +**Examples** +```javascript +toContinuousPointSet([ + {x: 0, y: 0.1}, + {x: 1, y: 0.2}, + {x: 2, y: 0.15}, + {x:3, y: 0.1} +]) +``` + +## toDiscretePointSet +Converts a set of points to a discrete distribution + +**Definitions** +```javascript +toDiscretePointSet(array>) +``` + +**Examples** +```javascript +toDiscretePointSet([ + {x: 0, y: 0.1}, + {x: 1, y: 0.2}, + {x: 2, y: 0.15}, + {x:3, y: 0.1} +]) +``` + +## Declaration (Continuous Function) +Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within. + +**Definitions** +```javascript +declareFn(dict<{fn: lambda, inputs: array>}>) +``` + +**Examples** +```javascript +declareFn({ + fn: {|a,b| a }, + inputs: [ + {min: 0, max: 100}, + {min: 30, max: 50} + ] +}) +``` \ No newline at end of file From b0b48c7129fdc91ad5c3327d39209603bf88511d Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 4 Jun 2022 09:26:52 -0700 Subject: [PATCH 02/20] First attempt at new API documentation generation --- .../FunctionRegistry_Core.res | 2 +- .../FunctionRegistry_Library.res | 6 + .../ReducerInterface_GenericDistribution.res | 2 - packages/website/docs/Api/Distribution.md | 434 ++++++++++++++++++ .../Api.md => Api/DistributionCreation.md} | 5 +- .../{Features => Guides}/Distributions.mdx | 0 .../docs/{Features => Guides}/Functions.mdx | 0 .../docs/{Features => Guides}/Language.mdx | 0 .../{Features => Guides}/Node-Packages.md | 0 packages/website/docusaurus.config.js | 1 - packages/website/sidebars.js | 14 +- packages/website/src/css/custom.css | 4 +- 12 files changed, 458 insertions(+), 10 deletions(-) create mode 100644 packages/website/docs/Api/Distribution.md rename packages/website/docs/{Features/Api.md => Api/DistributionCreation.md} (98%) rename packages/website/docs/{Features => Guides}/Distributions.mdx (100%) rename packages/website/docs/{Features => Guides}/Functions.mdx (100%) rename packages/website/docs/{Features => Guides}/Language.mdx (100%) rename packages/website/docs/{Features => Guides}/Node-Packages.md (100%) diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index b3e0c310..ab23287b 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -55,7 +55,7 @@ module FRType = { switch t { | FRTypeNumber => "number" | FRTypeNumeric => "numeric" - | FRTypeDistOrNumber => "frValueDistOrNumber" + | FRTypeDistOrNumber => "distribution|number" | FRTypeRecord(r) => { let input = ((name, frType): frTypeRecordParam) => `${name}: ${toString(frType)}` `{${r->E.A2.fmap(input)->E.A2.joinWith(", ")}}` diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index 011e8b13..33e85492 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -132,6 +132,12 @@ to(5,10) ~definitions=[OneArgDist.make("bernoulli", SymbolicDist.Bernoulli.make)], (), ), + Function.make( + ~name="PointMass", + ~examples=`pointMass(0.5)`, + ~definitions=[OneArgDist.make("pointMass", SymbolicDist.Float.makeSafe)], + (), + ), Function.make( ~name="toContinuousPointSet", ~description="Converts a set of points to a continuous distribution", diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res index dc827805..2cd01795 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res @@ -200,8 +200,6 @@ let dispatchToGenericOutput = ( ): option => { let (fnName, args) = call switch (fnName, args) { - | ("delta", [EvNumber(f)]) => - SymbolicDist.Float.makeSafe(f)->SymbolicConstructors.symbolicResultToOutput | ("triangular" as fnName, [EvNumber(f1), EvNumber(f2), EvNumber(f3)]) => SymbolicConstructors.threeFloat(fnName) ->E.R.bind(r => r(f1, f2, f3)) diff --git a/packages/website/docs/Api/Distribution.md b/packages/website/docs/Api/Distribution.md new file mode 100644 index 00000000..5a52d0da --- /dev/null +++ b/packages/website/docs/Api/Distribution.md @@ -0,0 +1,434 @@ +--- +sidebar_position: 2 +title: Distribution +--- + + +## mixture + +**Definition** +```javascript +mixture(...distributions, weights:list):distribution +``` + +**Examples** +```javascript +mixture(normal(5,1), normal(10,1)) +``` + +## sample +Get one random sample from the distribution + +**Definition** +```javascript +sample(distribution):number +``` + +**Examples** +```javascript +sample(normal(5,2)) +``` + +## sampleN +Get n random samples from the distribution + +**Definition** +```javascript +sample(distribution, number):list +``` + +**Examples** +```javascript +sample(normal(5,2), 100) +``` + +## mean +Get the distribution mean + +**Definition** +```javascript +mean(distribution):number +``` + +**Examples** +```javascript +mean(normal(5,2)) +``` + +## cdf + +**Definition** +```javascript +cdf(distribution, number):number +``` + +**Examples** +```javascript +cdf(normal(5,2), 3) +``` + +## pdf + +**Definition** +```javascript +pdf(distribution, number):number +``` + +**Examples** +```javascript +pdf(normal(5,2), 3) +``` + +## inv + +**Definition** +```javascript +inv(distribution, number):number +``` + +**Examples** +```javascript +inv(normal(5,2), 0.5) +``` + +## toPointSet +Converts a distribution to the pointSet format + +**Definition** +```javascript +toPointSet(distribution):pointSetDistribution +``` + +**Examples** +```javascript +toPointSet(normal(5,2)) +``` + +## toSampleSet +Converts a distribution to the sampleSet format, with n samples + +**Definition** +```javascript +toSampleSet(distribution,n):sampleSetDistribution +``` + +**Examples** +```javascript +toSampleSet(normal(5,2)) +``` + +## truncateLeft +Truncates the left side of a distribution. Returns either a pointSet distribution or a symbolic distribution. + +**Definition** +```javascript +truncateLeft(distribution, l:number):distribution +``` + +**Examples** +```javascript +truncateLeft(normal(5,2), 3) +``` + +## truncateRight +Truncates the right side of a distribution. Returns either a pointSet distribution or a symbolic distribution. + +**Definition** +```javascript +truncateRight(distribution, r:number):distribution +``` + +**Examples** +```javascript +truncateLeft(normal(5,2), 6) +``` + +## klDivergence +Kullback–Leibler divergence between two distributions + +**Definition** +```javascript +klDivergence(distribution, distribution):number +``` + +**Examples** +```javascript +klDivergence(normal(5,2), normal(5,4)) // returns 0.57 +``` + +## logScoreWithPointAnswer + +**Definition** +```javascript +logScoreWithPointAnswer(distribution, number):number +``` + +**Examples** +```javascript +logScoreWithPointAnswer(normal(5,2), 3) // returns 2.11 +``` + +## toString + +**Definition** +```javascript +toString(distribution):string +``` + +**Examples** +```javascript +toString(normal(5,2)) +``` + +## toSparkline +Produce a sparkline of length n + +**Definition** +```javascript +toSparkline(distribution, n=20):string +``` + +**Examples** +```javascript +toSparkline(normal(5,2), 10):string +``` + +## inspect +Prints the value of the distribution to the Javascript console, then returns the distribution. + +**Definition** +```javascript +inspect(distribution):distribution +``` + +**Examples** +```javascript +inspect(normal(5,2)) +``` + +## normalize +Normalize a distribution. This means scaling it appropriately so that it's cumulative sum is equal to 1. + +**Definition** +```javascript +normalize(distribution):distribution +``` + +**Examples** +```javascript +normalize(normal(5,2)) +``` + +## isNormalized +Check of a distribution is normalized. Most distributions are typically normalized, but there are some commands that could produce non-normalized distributions. + +**Definition** +```javascript +isNormalized(distribution):bool +``` + +**Examples** +```javascript +isNormalized(normal(5,2)) // returns true +``` + +## integralSum +Get the sum of the integral of a distribution. If the distribution is normalized, this will be 1. + +**Definition** +```javascript +integralSum(distribution):number +``` + +**Examples** +```javascript +integralSum(normal(5,2)) +``` + +## log + +**Definition** +```javascript +log(distribution):distribution +``` + + +## log10 + +**Definition** +```javascript +log10(distribution):distribution +``` + + +## unaryMinus + +**Definition** +```javascript +unaryMinus(distribution):distribution +``` + + +## add + +**Definition** +```javascript +dotSubtract(distribution, distribution): distribution +``` + + +## multiply + +**Definition** +```javascript +dotSubtract(distribution, distribution): distribution +``` + + +## subtract + +**Definition** +```javascript +dotSubtract(distribution, distribution): distribution +``` + + +## divide + +**Definition** +```javascript +dotSubtract(distribution, distribution): distribution +``` + + +## pow + +**Definition** +```javascript +dotSubtract(distribution, distribution): distribution +``` + + +## dotAdd + +**Definition** +```javascript +dotSubtract(distribution, distribution): distribution +``` + + +## dotMultiply + +**Definition** +```javascript +dotSubtract(distribution, distribution): distribution +``` + + +## dotSubtract + +**Definition** +```javascript +dotSubtract(distribution, distribution): distribution +``` + + +## dotDivide + +**Definition** +```javascript +dotSubtract(distribution, distribution): distribution +``` + + +## dotPow + +**Definition** +```javascript +dotSubtract(distribution, distribution): distribution +``` + + +## dotExp + +**Definition** +```javascript +dotSubtract(distribution, distribution): distribution +``` + + +## scaleLog + +**Definition** +```javascript +scaleLog(distribution): distribution +``` + + +## scaleLog10 + +**Definition** +```javascript +dotSubtract(distribution, distribution): distribution +``` + + +## scaleLogWithThreshold + +**Definition** +```javascript +dotSubtract(distribution, distribution): distribution +``` + + +## scalePow + +**Definition** +```javascript +dotSubtract(distribution, distribution): distribution +``` + + +## scaleExp + +**Definition** +```javascript +dotSubtract(distribution, distribution): distribution +``` + + +## toInternalSampleArray +Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toInternalSampleArray() maintains order and length. + +**Definition** +```javascript +toInternalSampleArray(sampleSetDist):list +``` + +**Examples** +```javascript +toInternalSampleArray(toSampleSet(normal(5,2))) +``` + +## mapSamples + +**Definition** +```javascript +dotSubtract(distribution, distribution): distribution +``` + + +## mapSamples2 + +**Definition** +```javascript +dotSubtract(distribution, distribution): distribution +``` + + +## mapSamples3 + +**Definition** +```javascript +dotSubtract(distribution, distribution): distribution +``` diff --git a/packages/website/docs/Features/Api.md b/packages/website/docs/Api/DistributionCreation.md similarity index 98% rename from packages/website/docs/Features/Api.md rename to packages/website/docs/Api/DistributionCreation.md index 4955d498..ce139608 100644 --- a/packages/website/docs/Features/Api.md +++ b/packages/website/docs/Api/DistributionCreation.md @@ -1,7 +1,8 @@ --- -sidebar_position: 5 -title: API +sidebar_position: 1 +title: Distribution Creation --- + ## Normal Distribution **Definitions** diff --git a/packages/website/docs/Features/Distributions.mdx b/packages/website/docs/Guides/Distributions.mdx similarity index 100% rename from packages/website/docs/Features/Distributions.mdx rename to packages/website/docs/Guides/Distributions.mdx diff --git a/packages/website/docs/Features/Functions.mdx b/packages/website/docs/Guides/Functions.mdx similarity index 100% rename from packages/website/docs/Features/Functions.mdx rename to packages/website/docs/Guides/Functions.mdx diff --git a/packages/website/docs/Features/Language.mdx b/packages/website/docs/Guides/Language.mdx similarity index 100% rename from packages/website/docs/Features/Language.mdx rename to packages/website/docs/Guides/Language.mdx diff --git a/packages/website/docs/Features/Node-Packages.md b/packages/website/docs/Guides/Node-Packages.md similarity index 100% rename from packages/website/docs/Features/Node-Packages.md rename to packages/website/docs/Guides/Node-Packages.md diff --git a/packages/website/docusaurus.config.js b/packages/website/docusaurus.config.js index ca7b3a8c..68d440c8 100644 --- a/packages/website/docusaurus.config.js +++ b/packages/website/docusaurus.config.js @@ -20,7 +20,6 @@ const config = { projectName: "squiggle", // Usually your repo name. plugins: [ - "docusaurus-tailwindcss", () => ({ configureWebpack(config, isServer, utils, content) { return { diff --git a/packages/website/sidebars.js b/packages/website/sidebars.js index 78ad249f..5db00f6c 100644 --- a/packages/website/sidebars.js +++ b/packages/website/sidebars.js @@ -22,11 +22,21 @@ const sidebars = { }, { type: "category", - label: "Features", + label: "Guides", items: [ { type: "autogenerated", - dirName: "Features", + dirName: "Guides", + }, + ], + }, + { + type: "category", + label: "API", + items: [ + { + type: "autogenerated", + dirName: "Api", }, ], }, diff --git a/packages/website/src/css/custom.css b/packages/website/src/css/custom.css index b07d10f7..dda82372 100644 --- a/packages/website/src/css/custom.css +++ b/packages/website/src/css/custom.css @@ -4,9 +4,9 @@ * work well for content-centric websites. */ -@tailwind base; +/* @tailwind base; @tailwind components; -@tailwind utilities; +@tailwind utilities; */ /* You can override the default Infima variables here. */ :root { From 19477fd637db1e0c2c84cb12fdf962e88de6a3cd Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 4 Jun 2022 09:36:30 -0700 Subject: [PATCH 03/20] Fixed broken links --- packages/website/docs/Introduction.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/website/docs/Introduction.md b/packages/website/docs/Introduction.md index e81b0782..35ff63b6 100644 --- a/packages/website/docs/Introduction.md +++ b/packages/website/docs/Introduction.md @@ -9,8 +9,8 @@ Squiggle is an _estimation language_, and a syntax for _calculating and expressi - [Gallery](./Discussions/Gallery) - [Squiggle playground](/playground) -- [Language basics](./Features/Language) -- [Squiggle functions source of truth](./docs/Features/Functions) +- [Language basics](./Guides/Language) +- [Squiggle functions source of truth](./docs/Guides/Functions) - [Known bugs](./Discussions/Bugs) - [Original lesswrong sequence](https://www.lesswrong.com/s/rDe8QE5NvXcZYzgZ3) - [Author your squiggle models as Observable notebooks](https://observablehq.com/@hazelfire/squiggle) From d49f7889b0b7443dfe9ab77dd047d7662fa8c2cc Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sun, 5 Jun 2022 13:59:45 -0700 Subject: [PATCH 04/20] First attempt at most type definitions --- packages/website/docs/Api/Dict.md | 59 +++++ packages/website/docs/Api/Distribution.md | 280 ++++++++++----------- packages/website/docs/Api/Duration.md | 94 +++++++ packages/website/docs/Api/List.md | 185 ++++++++++++++ packages/website/docs/Api/Math.md | 90 +++++++ packages/website/docs/Api/Number.md | 193 ++++++++++++++ packages/website/docs/Api/PointSetDist.md | 24 ++ packages/website/docs/Api/SampleSetDist.md | 57 +++++ 8 files changed, 842 insertions(+), 140 deletions(-) create mode 100644 packages/website/docs/Api/Dict.md create mode 100644 packages/website/docs/Api/Duration.md create mode 100644 packages/website/docs/Api/List.md create mode 100644 packages/website/docs/Api/Math.md create mode 100644 packages/website/docs/Api/Number.md create mode 100644 packages/website/docs/Api/PointSetDist.md create mode 100644 packages/website/docs/Api/SampleSetDist.md diff --git a/packages/website/docs/Api/Dict.md b/packages/website/docs/Api/Dict.md new file mode 100644 index 00000000..758047b6 --- /dev/null +++ b/packages/website/docs/Api/Dict.md @@ -0,0 +1,59 @@ +--- +sidebar_position: 9 +title: Dict +--- + +### toString + +```javascript +(dict):string +``` + + +### get + +```javascript +(dict, string):a +``` + + +### set + +```javascript +(dict, string, a):a +``` + + +### toPairs + +```javascript +(dict):list> +``` + + +### keys + +```javascript +(dict):list +``` + + +### values + +```javascript +(dict):list +``` + + +### merge + +```javascript +(dict, dict):dict +``` + + +### mergeMany + +```javascript +(list>):dict +``` diff --git a/packages/website/docs/Api/Distribution.md b/packages/website/docs/Api/Distribution.md index 5a52d0da..92da030b 100644 --- a/packages/website/docs/Api/Distribution.md +++ b/packages/website/docs/Api/Distribution.md @@ -2,26 +2,24 @@ sidebar_position: 2 title: Distribution --- +## Main +### mixture -## mixture - -**Definition** ```javascript -mixture(...distributions, weights:list):distribution +(...distributionLike, weights:list):distribution ``` **Examples** ```javascript -mixture(normal(5,1), normal(10,1)) +mixture(normal(5,1), normal(10,1)) ``` -## sample +### sample Get one random sample from the distribution -**Definition** ```javascript -sample(distribution):number +(distribution):number ``` **Examples** @@ -29,12 +27,11 @@ sample(distribution):number sample(normal(5,2)) ``` -## sampleN +### sampleN Get n random samples from the distribution -**Definition** ```javascript -sample(distribution, number):list +(distribution, number):list ``` **Examples** @@ -42,12 +39,11 @@ sample(distribution, number):list sample(normal(5,2), 100) ``` -## mean +### mean Get the distribution mean -**Definition** ```javascript -mean(distribution):number +(distribution):number ``` **Examples** @@ -55,11 +51,31 @@ mean(distribution):number mean(normal(5,2)) ``` -## cdf +### stdev -**Definition** ```javascript -cdf(distribution, number):number +(distribution):number +``` + + +### variance + +```javascript +(distribution):number +``` + + +### mode + +```javascript +(distribution):number +``` + + +### cdf + +```javascript +(distribution, number):number ``` **Examples** @@ -67,11 +83,10 @@ cdf(distribution, number):number cdf(normal(5,2), 3) ``` -## pdf +### pdf -**Definition** ```javascript -pdf(distribution, number):number +(distribution, number):number ``` **Examples** @@ -79,11 +94,21 @@ pdf(distribution, number):number pdf(normal(5,2), 3) ``` -## inv +### pmf -**Definition** ```javascript -inv(distribution, number):number +(distribution, number):number +``` + +**Examples** +```javascript +pmf(bernoulli(0.3), 0) // 0.7 +``` + +### inv + +```javascript +(distribution, number):number ``` **Examples** @@ -91,12 +116,11 @@ inv(distribution, number):number inv(normal(5,2), 0.5) ``` -## toPointSet +### toPointSet Converts a distribution to the pointSet format -**Definition** ```javascript -toPointSet(distribution):pointSetDistribution +(distribution):pointSetDistribution ``` **Examples** @@ -104,12 +128,11 @@ toPointSet(distribution):pointSetDistribution toPointSet(normal(5,2)) ``` -## toSampleSet +### toSampleSet Converts a distribution to the sampleSet format, with n samples -**Definition** ```javascript -toSampleSet(distribution,n):sampleSetDistribution +(distribution,n):sampleSetribution ``` **Examples** @@ -117,12 +140,11 @@ toSampleSet(distribution,n):sampleSetDistribution toSampleSet(normal(5,2)) ``` -## truncateLeft +### truncateLeft Truncates the left side of a distribution. Returns either a pointSet distribution or a symbolic distribution. -**Definition** ```javascript -truncateLeft(distribution, l:number):distribution +(distribution, l:number, {normalize: boolean=true}):distribution ``` **Examples** @@ -130,12 +152,11 @@ truncateLeft(distribution, l:number):distribution truncateLeft(normal(5,2), 3) ``` -## truncateRight +### truncateRight Truncates the right side of a distribution. Returns either a pointSet distribution or a symbolic distribution. -**Definition** ```javascript -truncateRight(distribution, r:number):distribution +(distribution, r:number, {normalize: boolean=true}):distribution ``` **Examples** @@ -143,12 +164,11 @@ truncateRight(distribution, r:number):distribution truncateLeft(normal(5,2), 6) ``` -## klDivergence +### klDivergence Kullback–Leibler divergence between two distributions -**Definition** ```javascript -klDivergence(distribution, distribution):number +(distribution, distribution):number ``` **Examples** @@ -156,23 +176,21 @@ klDivergence(distribution, distribution):number klDivergence(normal(5,2), normal(5,4)) // returns 0.57 ``` -## logScoreWithPointAnswer +### logScore -**Definition** ```javascript -logScoreWithPointAnswer(distribution, number):number +({estimate: distribution, prior?: distribution, answer: distribution|number}):number ``` **Examples** ```javascript -logScoreWithPointAnswer(normal(5,2), 3) // returns 2.11 +logScore({estimate: normal(5,2), prior: normal(5.5,4), answer: 2.3}) ``` -## toString +### toString -**Definition** ```javascript -toString(distribution):string +(distribution):string ``` **Examples** @@ -180,25 +198,23 @@ toString(distribution):string toString(normal(5,2)) ``` -## toSparkline +### toSparkline Produce a sparkline of length n -**Definition** ```javascript -toSparkline(distribution, n=20):string +(distribution, n=20):string ``` **Examples** ```javascript -toSparkline(normal(5,2), 10):string +toSparkline(normal(5,2), 10) ``` -## inspect +### inspect Prints the value of the distribution to the Javascript console, then returns the distribution. -**Definition** ```javascript -inspect(distribution):distribution +(distribution):distribution ``` **Examples** @@ -206,12 +222,11 @@ inspect(distribution):distribution inspect(normal(5,2)) ``` -## normalize +### normalize Normalize a distribution. This means scaling it appropriately so that it's cumulative sum is equal to 1. -**Definition** ```javascript -normalize(distribution):distribution +(distribution):distribution ``` **Examples** @@ -219,12 +234,11 @@ normalize(distribution):distribution normalize(normal(5,2)) ``` -## isNormalized +### isNormalized Check of a distribution is normalized. Most distributions are typically normalized, but there are some commands that could produce non-normalized distributions. -**Definition** ```javascript -isNormalized(distribution):bool +(distribution):bool ``` **Examples** @@ -232,12 +246,11 @@ isNormalized(distribution):bool isNormalized(normal(5,2)) // returns true ``` -## integralSum +### integralSum Get the sum of the integral of a distribution. If the distribution is normalized, this will be 1. -**Definition** ```javascript -integralSum(distribution):number +(distribution):number ``` **Examples** @@ -245,190 +258,177 @@ integralSum(distribution):number integralSum(normal(5,2)) ``` -## log +### add -**Definition** ```javascript -log(distribution):distribution +(distributionLike, distributionLike): distribution ``` -## log10 +### sum -**Definition** ```javascript -log10(distribution):distribution +(list): distribution ``` -## unaryMinus +### multiply -**Definition** ```javascript -unaryMinus(distribution):distribution +(distributionLike, distributionLike): distribution ``` -## add +### product -**Definition** ```javascript -dotSubtract(distribution, distribution): distribution +(list): distribution ``` -## multiply +### subtract -**Definition** ```javascript -dotSubtract(distribution, distribution): distribution +(distributionLike, distributionLike): distribution ``` -## subtract +### divide -**Definition** ```javascript -dotSubtract(distribution, distribution): distribution +(distributionLike, distributionLike): distribution ``` -## divide +### pow -**Definition** ```javascript -dotSubtract(distribution, distribution): distribution +(distributionLike, distributionLike): distribution ``` -## pow +### exp -**Definition** ```javascript -dotSubtract(distribution, distribution): distribution +(distributionLike, distributionLike): distribution ``` -## dotAdd +### log -**Definition** ```javascript -dotSubtract(distribution, distribution): distribution +(distributionLike, distributionLike): distribution ``` -## dotMultiply +### log10 -**Definition** ```javascript -dotSubtract(distribution, distribution): distribution +(distributionLike, distributionLike):distribution ``` -## dotSubtract +### unaryMinus -**Definition** ```javascript -dotSubtract(distribution, distribution): distribution +(distribution):distribution ``` -## dotDivide +### dotAdd -**Definition** ```javascript -dotSubtract(distribution, distribution): distribution +(distributionLike, distributionLike): distribution ``` -## dotPow +### dotSum -**Definition** ```javascript -dotSubtract(distribution, distribution): distribution +(list): distribution ``` -## dotExp +### dotMultiply -**Definition** ```javascript -dotSubtract(distribution, distribution): distribution +(distributionLike, distributionLike): distribution ``` -## scaleLog +### dotProduct -**Definition** ```javascript -scaleLog(distribution): distribution +(list): distribution ``` -## scaleLog10 +### dotSubtract -**Definition** ```javascript -dotSubtract(distribution, distribution): distribution +(distributionLike, distributionLike): distribution ``` -## scaleLogWithThreshold +### dotDivide -**Definition** ```javascript -dotSubtract(distribution, distribution): distribution +(distributionLike, distributionLike): distribution ``` -## scalePow +### dotPow -**Definition** ```javascript -dotSubtract(distribution, distribution): distribution +(distributionLike, distributionLike): distribution ``` -## scaleExp +### dotExp -**Definition** ```javascript -dotSubtract(distribution, distribution): distribution +(distributionLike, distributionLike): distribution ``` -## toInternalSampleArray -Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toInternalSampleArray() maintains order and length. +### scaleMultiply -**Definition** ```javascript -toInternalSampleArray(sampleSetDist):list -``` - -**Examples** -```javascript -toInternalSampleArray(toSampleSet(normal(5,2))) -``` - -## mapSamples - -**Definition** -```javascript -dotSubtract(distribution, distribution): distribution +(distributionLike, distributionLike): distribution ``` -## mapSamples2 +### scalePow -**Definition** ```javascript -dotSubtract(distribution, distribution): distribution +(distributionLike, distributionLike): distribution ``` -## mapSamples3 +### scaleExp -**Definition** ```javascript -dotSubtract(distribution, distribution): distribution +(distributionLike, distributionLike): distribution ``` + + +### scaleLog + +```javascript +(distributionLike, distributionLike): distribution +``` + + +### scaleLog10 + +```javascript +(distributionLike, distributionLike): distribution +``` + + +### scaleLogWithThreshold + +```javascript +(distributionLike, distributionLike, number): distribution +``` + diff --git a/packages/website/docs/Api/Duration.md b/packages/website/docs/Api/Duration.md new file mode 100644 index 00000000..c4495dcb --- /dev/null +++ b/packages/website/docs/Api/Duration.md @@ -0,0 +1,94 @@ +--- +sidebar_position: 10 +title: Duration +--- + +### toString + +```javascript +(duration):string +``` + + +### minutes + +```javascript +(number):duration +``` + + +### hours + +```javascript +(number):duration +``` + + +### days + +```javascript +(number):duration +``` + + +### years + +```javascript +(number):duration +``` + + +### toHours + +```javascript +(duration):number +``` + + +### toMinutes + +```javascript +(duration):number +``` + + +### toDays + +```javascript +(duration):number +``` + + +### toYears + +```javascript +(duration):number +``` + + +### add + +```javascript +(duration, duration):duration +``` + + +### subtract + +```javascript +(duration, duration):duration +``` + + +### multiply + +```javascript +(duration, duration):duration +``` + + +### divide + +```javascript +(duration, duration):duration +``` \ No newline at end of file diff --git a/packages/website/docs/Api/List.md b/packages/website/docs/Api/List.md new file mode 100644 index 00000000..c352f42d --- /dev/null +++ b/packages/website/docs/Api/List.md @@ -0,0 +1,185 @@ +--- +sidebar_position: 4 +title: List +--- + +### toString + +```javascript +(list<'a>):string +``` + + +### length + +```javascript +(list<'a>):number +``` + + +### get + +```javascript +(list, number):a +``` + + +### find + +```javascript +(list, e => bool):a +``` + + +### filter + +```javascript +(list, e => bool):a +``` + + +### set + +```javascript +(list, number, a):a +``` + + +### shuffle + +```javascript +(list):list +``` + + +### reverse + +```javascript +(list):list +``` + + +### make + +```javascript +(number,a):list (number, (index:number => a)):list (pointSetDist):list +``` + + +### range + +```javascript +(low:number, high:number) => list +``` + + +### rangeBy + +```javascript +(low:number, high:number, increment: number) => list +``` + + +### zip + +```javascript +(list, list):list> +``` + + +### unzip + +```javascript +(list>):list, list> +``` + + +### concat + +```javascript +(list, list): list +``` + + +### concatMany + +```javascript +(list>):list +``` + + +### slice + +```javascript + +``` + + +### map + +```javascript +(list, (a -> b)): list +``` + + +### reduce + +```javascript + +``` + + +### reduceRight + +```javascript + +``` + + +### includes + +```javascript +(list<'a>, 'a => bool):boolean +``` + + +### every + +```javascript +(list<'a>, 'a => bool):boolean +``` + + +### truncate + +```javascript +(list<'a>, number):list<'a> +``` + + +### uniq + +```javascript +(list<'a>):list +``` + + +### first + +```javascript +(list<'a>):'a +``` + + +### last + +```javascript +(list<'a>):'a +``` + + +### sort + +```javascript +(list<'a>):list +``` \ No newline at end of file diff --git a/packages/website/docs/Api/Math.md b/packages/website/docs/Api/Math.md new file mode 100644 index 00000000..1a52077b --- /dev/null +++ b/packages/website/docs/Api/Math.md @@ -0,0 +1,90 @@ +--- +sidebar_position: 5 +title: Math +--- + +### E +Euler's number; ≈ 2.718281828459045 + +```javascript +number +``` + + +### LN2 +Natural logarithm of 2; ≈ 0.6931471805599453 + +```javascript +number +``` + + +### LN10 +Natural logarithm of 10; ≈ 2.302585092994046 + +```javascript +number +``` + + +### LOG2E +Base 2 logarithm of E; ≈ 1.4426950408889634 + +```javascript +number +``` + + +### LOG10E +Base 10 logarithm of E; ≈ 0.4342944819032518 + +```javascript +number +``` + + +### PI +Pi - ratio of the circumference to the diameter of a circle; ≈ 3.141592653589793 + +```javascript +number +``` + + +### SQRT1_2 +Square root of 1/2; ≈ 0.7071067811865476 + +```javascript +number +``` + + +### SQRT2 +Square root of 2; ≈ 1.4142135623730951 + +```javascript +number +``` + + +### PHI +Phi is the golden ratio. 1.618033988749895 + +```javascript +number +``` + + +### TAU +Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi. 6.283185307179586 + +```javascript +number +``` + + +### Infinity + +```javascript +number +``` \ No newline at end of file diff --git a/packages/website/docs/Api/Number.md b/packages/website/docs/Api/Number.md new file mode 100644 index 00000000..d8acfe52 --- /dev/null +++ b/packages/website/docs/Api/Number.md @@ -0,0 +1,193 @@ +--- +sidebar_position: 6 +title: Number +--- + + +### ceil + +```javascript +(number): number +``` + + +### floor + +```javascript +(number): number +``` + + +### abs + +```javascript +(number): number +``` + + +### round + +```javascript +(number): number +``` + + +### max + +```javascript +(list): number +``` + + +### maxBy + +```javascript +(list, fn(element)):number +``` + + +### min + +```javascript +(list): number +``` + + +### minBy + +```javascript +(list, fn(element)):number +``` + + +### random + +```javascript +number +``` + + +### randomInt + +```javascript +number +``` + + +### mean + +```javascript +(list): number +``` + + +### median + +```javascript +(list): number +``` + + +### mode + +```javascript +(list): number +``` + + +### std + +```javascript +(list): number +``` + + +### variance + +```javascript +(list): number +``` + + +### unaryMinus + +```javascript +(number): number +``` + + +### equal + +```javascript +(number, number): boolean +``` + + +### add + +```javascript +(number, number): number +``` + + +### sum + +```javascript +(number, number): number +``` + + +### multiply + +```javascript +(number, number): number +``` + + +### product + +```javascript +(number, number): number +``` + + +### subtract + +```javascript +(number, number): number +``` + + +### divide + +```javascript +(number, number): number +``` + + +### pow + +```javascript +(number, number): number +``` + + +### exp + +```javascript +(number): number +``` + + +### log + +```javascript +(number, number=Math.e): number +``` + + +### log10 + +```javascript +(number): number +``` \ No newline at end of file diff --git a/packages/website/docs/Api/PointSetDist.md b/packages/website/docs/Api/PointSetDist.md new file mode 100644 index 00000000..9dfe976f --- /dev/null +++ b/packages/website/docs/Api/PointSetDist.md @@ -0,0 +1,24 @@ +--- +sidebar_position: 7 +title: Point Set Distribution +--- + +### makeContinuous + +```javascript +(list<{x: number, y: number}>): pointSetDist +``` + + +### makeDiscrete + +```javascript +(list<{x: number, y: number}>): pointSetDist +``` + + +### map + +```javascript +(pointSetDist, ({x:number,y:number}=>{x:number,y:number})):pointSetDist +``` \ No newline at end of file diff --git a/packages/website/docs/Api/SampleSetDist.md b/packages/website/docs/Api/SampleSetDist.md new file mode 100644 index 00000000..b7553988 --- /dev/null +++ b/packages/website/docs/Api/SampleSetDist.md @@ -0,0 +1,57 @@ +--- +sidebar_position: 8 +title: Sample Set Distribution +--- + +### toInternalSampleArray +Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toInternalSampleArray() maintains order and length. + +```javascript +(sampleSet):list +``` + +**Examples** +```javascript +toInternalSampleArray(toSampleSet(normal(5,2))) +``` + +### kde + +```javascript +(sampleSet):pointSetDist +``` + + +### toEmpiricalPdf + +```javascript +(sampleSet):pointSetDist +``` + + +### map + +```javascript +(sampleSet, (r => number)): sampleSet +``` + + +### map2 + +```javascript +(sampleSet, sampleSet, ((d1, d2)=>number)): sampleSet +``` + + +### map3 + +```javascript +(sampleSet, sampleSet, sampleSet, ((d1, d2, d3)=>number)): sampleSet +``` + + +### make + +```javascript +(dist): sampleSet (()=>number): sampleSet (list): sampleSet +``` \ No newline at end of file From 4409ceb6c7700dd9618b6583ac08e02a5eeddf6d Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sun, 5 Jun 2022 14:13:56 -0700 Subject: [PATCH 05/20] Formatted code --- packages/website/docs/Api/Dict.md | 7 - packages/website/docs/Api/Distribution.md | 102 +++++++------- .../website/docs/Api/DistributionCreation.md | 130 +++++++++++------- packages/website/docs/Api/Duration.md | 14 +- packages/website/docs/Api/List.md | 27 +--- packages/website/docs/Api/Math.md | 46 +++---- packages/website/docs/Api/Number.md | 33 +---- packages/website/docs/Api/PointSetDist.md | 4 +- packages/website/docs/Api/SampleSetDist.md | 11 +- 9 files changed, 169 insertions(+), 205 deletions(-) diff --git a/packages/website/docs/Api/Dict.md b/packages/website/docs/Api/Dict.md index 758047b6..c2716fa5 100644 --- a/packages/website/docs/Api/Dict.md +++ b/packages/website/docs/Api/Dict.md @@ -9,49 +9,42 @@ title: Dict (dict):string ``` - ### get ```javascript (dict, string):a ``` - ### set ```javascript (dict, string, a):a ``` - ### toPairs ```javascript (dict):list> ``` - ### keys ```javascript (dict):list ``` - ### values ```javascript (dict):list ``` - ### merge ```javascript (dict, dict):dict ``` - ### mergeMany ```javascript diff --git a/packages/website/docs/Api/Distribution.md b/packages/website/docs/Api/Distribution.md index 92da030b..e3184305 100644 --- a/packages/website/docs/Api/Distribution.md +++ b/packages/website/docs/Api/Distribution.md @@ -2,6 +2,7 @@ sidebar_position: 2 title: Distribution --- + ## Main ### mixture @@ -11,11 +12,13 @@ title: Distribution ``` **Examples** + ```javascript -mixture(normal(5,1), normal(10,1)) +mixture(normal(5, 1), normal(10, 1)); ``` ### sample + Get one random sample from the distribution ```javascript @@ -23,11 +26,13 @@ Get one random sample from the distribution ``` **Examples** + ```javascript -sample(normal(5,2)) +sample(normal(5, 2)); ``` ### sampleN + Get n random samples from the distribution ```javascript @@ -35,11 +40,13 @@ Get n random samples from the distribution ``` **Examples** + ```javascript -sample(normal(5,2), 100) +sample(normal(5, 2), 100); ``` ### mean + Get the distribution mean ```javascript @@ -47,8 +54,9 @@ Get the distribution mean ``` **Examples** + ```javascript -mean(normal(5,2)) +mean(normal(5, 2)); ``` ### stdev @@ -57,21 +65,18 @@ mean(normal(5,2)) (distribution):number ``` - ### variance ```javascript (distribution):number ``` - ### mode ```javascript (distribution):number ``` - ### cdf ```javascript @@ -79,8 +84,9 @@ mean(normal(5,2)) ``` **Examples** + ```javascript -cdf(normal(5,2), 3) +cdf(normal(5, 2), 3); ``` ### pdf @@ -90,8 +96,9 @@ cdf(normal(5,2), 3) ``` **Examples** + ```javascript -pdf(normal(5,2), 3) +pdf(normal(5, 2), 3); ``` ### pmf @@ -101,8 +108,9 @@ pdf(normal(5,2), 3) ``` **Examples** + ```javascript -pmf(bernoulli(0.3), 0) // 0.7 +pmf(bernoulli(0.3), 0); // 0.7 ``` ### inv @@ -112,11 +120,13 @@ pmf(bernoulli(0.3), 0) // 0.7 ``` **Examples** + ```javascript -inv(normal(5,2), 0.5) +inv(normal(5, 2), 0.5); ``` ### toPointSet + Converts a distribution to the pointSet format ```javascript @@ -124,11 +134,13 @@ Converts a distribution to the pointSet format ``` **Examples** + ```javascript -toPointSet(normal(5,2)) +toPointSet(normal(5, 2)); ``` ### toSampleSet + Converts a distribution to the sampleSet format, with n samples ```javascript @@ -136,11 +148,13 @@ Converts a distribution to the sampleSet format, with n samples ``` **Examples** + ```javascript -toSampleSet(normal(5,2)) +toSampleSet(normal(5, 2)); ``` ### truncateLeft + Truncates the left side of a distribution. Returns either a pointSet distribution or a symbolic distribution. ```javascript @@ -148,11 +162,13 @@ Truncates the left side of a distribution. Returns either a pointSet distributio ``` **Examples** + ```javascript -truncateLeft(normal(5,2), 3) +truncateLeft(normal(5, 2), 3); ``` ### truncateRight + Truncates the right side of a distribution. Returns either a pointSet distribution or a symbolic distribution. ```javascript @@ -160,11 +176,13 @@ Truncates the right side of a distribution. Returns either a pointSet distributi ``` **Examples** + ```javascript -truncateLeft(normal(5,2), 6) +truncateLeft(normal(5, 2), 6); ``` ### klDivergence + Kullback–Leibler divergence between two distributions ```javascript @@ -172,8 +190,9 @@ Kullback–Leibler divergence between two distributions ``` **Examples** + ```javascript -klDivergence(normal(5,2), normal(5,4)) // returns 0.57 +klDivergence(normal(5, 2), normal(5, 4)); // returns 0.57 ``` ### logScore @@ -183,8 +202,9 @@ klDivergence(normal(5,2), normal(5,4)) // returns 0.57 ``` **Examples** + ```javascript -logScore({estimate: normal(5,2), prior: normal(5.5,4), answer: 2.3}) +logScore({ estimate: normal(5, 2), prior: normal(5.5, 4), answer: 2.3 }); ``` ### toString @@ -194,11 +214,13 @@ logScore({estimate: normal(5,2), prior: normal(5.5,4), answer: 2.3}) ``` **Examples** + ```javascript -toString(normal(5,2)) +toString(normal(5, 2)); ``` ### toSparkline + Produce a sparkline of length n ```javascript @@ -206,11 +228,13 @@ Produce a sparkline of length n ``` **Examples** + ```javascript -toSparkline(normal(5,2), 10) +toSparkline(normal(5, 2), 10); ``` ### inspect + Prints the value of the distribution to the Javascript console, then returns the distribution. ```javascript @@ -218,11 +242,13 @@ Prints the value of the distribution to the Javascript console, then returns the ``` **Examples** + ```javascript -inspect(normal(5,2)) +inspect(normal(5, 2)); ``` ### normalize + Normalize a distribution. This means scaling it appropriately so that it's cumulative sum is equal to 1. ```javascript @@ -230,11 +256,13 @@ Normalize a distribution. This means scaling it appropriately so that it's cumul ``` **Examples** + ```javascript -normalize(normal(5,2)) +normalize(normal(5, 2)); ``` ### isNormalized + Check of a distribution is normalized. Most distributions are typically normalized, but there are some commands that could produce non-normalized distributions. ```javascript @@ -242,11 +270,13 @@ Check of a distribution is normalized. Most distributions are typically normaliz ``` **Examples** + ```javascript -isNormalized(normal(5,2)) // returns true +isNormalized(normal(5, 2)); // returns true ``` ### integralSum + Get the sum of the integral of a distribution. If the distribution is normalized, this will be 1. ```javascript @@ -254,8 +284,9 @@ Get the sum of the integral of a distribution. If the distribution is normalized ``` **Examples** + ```javascript -integralSum(normal(5,2)) +integralSum(normal(5, 2)); ``` ### add @@ -264,171 +295,146 @@ integralSum(normal(5,2)) (distributionLike, distributionLike): distribution ``` - ### sum ```javascript (list): distribution ``` - ### multiply ```javascript (distributionLike, distributionLike): distribution ``` - ### product ```javascript (list): distribution ``` - ### subtract ```javascript (distributionLike, distributionLike): distribution ``` - ### divide ```javascript (distributionLike, distributionLike): distribution ``` - ### pow ```javascript (distributionLike, distributionLike): distribution ``` - ### exp ```javascript (distributionLike, distributionLike): distribution ``` - ### log ```javascript (distributionLike, distributionLike): distribution ``` - ### log10 ```javascript (distributionLike, distributionLike):distribution ``` - ### unaryMinus ```javascript (distribution):distribution ``` - ### dotAdd ```javascript (distributionLike, distributionLike): distribution ``` - ### dotSum ```javascript (list): distribution ``` - ### dotMultiply ```javascript (distributionLike, distributionLike): distribution ``` - ### dotProduct ```javascript (list): distribution ``` - ### dotSubtract ```javascript (distributionLike, distributionLike): distribution ``` - ### dotDivide ```javascript (distributionLike, distributionLike): distribution ``` - ### dotPow ```javascript (distributionLike, distributionLike): distribution ``` - ### dotExp ```javascript (distributionLike, distributionLike): distribution ``` - ### scaleMultiply ```javascript (distributionLike, distributionLike): distribution ``` - ### scalePow ```javascript (distributionLike, distributionLike): distribution ``` - ### scaleExp ```javascript (distributionLike, distributionLike): distribution ``` - ### scaleLog ```javascript (distributionLike, distributionLike): distribution ``` - ### scaleLog10 ```javascript (distributionLike, distributionLike): distribution ``` - ### scaleLogWithThreshold ```javascript (distributionLike, distributionLike, number): distribution ``` - diff --git a/packages/website/docs/Api/DistributionCreation.md b/packages/website/docs/Api/DistributionCreation.md index ce139608..6663d878 100644 --- a/packages/website/docs/Api/DistributionCreation.md +++ b/packages/website/docs/Api/DistributionCreation.md @@ -5,115 +5,136 @@ title: Distribution Creation ## Normal Distribution -**Definitions** +**Definitions** + ```javascript -normal(frValueDistOrNumber, frValueDistOrNumber) +normal(frValueDistOrNumber, frValueDistOrNumber); ``` + ```javascript normal(dict<{p5: frValueDistOrNumber, p95: frValueDistOrNumber}>) ``` + ```javascript normal(dict<{mean: frValueDistOrNumber, stdev: frValueDistOrNumber}>) ``` **Examples** + ```javascript -normal(5,1) -normal({p5: 4, p95: 10}) -normal({mean: 5, stdev: 2}) +normal(5, 1); +normal({ p5: 4, p95: 10 }); +normal({ mean: 5, stdev: 2 }); ``` ## Lognormal Distribution -**Definitions** +**Definitions** + ```javascript -lognormal(frValueDistOrNumber, frValueDistOrNumber) +lognormal(frValueDistOrNumber, frValueDistOrNumber); ``` + ```javascript lognormal(dict<{p5: frValueDistOrNumber, p95: frValueDistOrNumber}>) ``` + ```javascript lognormal(dict<{mean: frValueDistOrNumber, stdev: frValueDistOrNumber}>) ``` **Examples** + ```javascript -lognormal(0.5, 0.8) -lognormal({p5: 4, p95: 10}) -lognormal({mean: 5, stdev: 2}) +lognormal(0.5, 0.8); +lognormal({ p5: 4, p95: 10 }); +lognormal({ mean: 5, stdev: 2 }); ``` ## Uniform Distribution -**Definitions** +**Definitions** + ```javascript -uniform(frValueDistOrNumber, frValueDistOrNumber) +uniform(frValueDistOrNumber, frValueDistOrNumber); ``` **Examples** + ```javascript -uniform(10, 12) +uniform(10, 12); ``` ## Beta Distribution -**Definitions** +**Definitions** + ```javascript -beta(frValueDistOrNumber, frValueDistOrNumber) +beta(frValueDistOrNumber, frValueDistOrNumber); ``` **Examples** + ```javascript -beta(20, 25) +beta(20, 25); ``` ## Cauchy Distribution -**Definitions** +**Definitions** + ```javascript -cauchy(frValueDistOrNumber, frValueDistOrNumber) +cauchy(frValueDistOrNumber, frValueDistOrNumber); ``` **Examples** + ```javascript -cauchy(5, 1) +cauchy(5, 1); ``` ## Gamma Distribution -**Definitions** +**Definitions** + ```javascript -gamma(frValueDistOrNumber, frValueDistOrNumber) +gamma(frValueDistOrNumber, frValueDistOrNumber); ``` **Examples** + ```javascript -gamma(5, 1) +gamma(5, 1); ``` ## Logistic Distribution -**Definitions** +**Definitions** + ```javascript -logistic(frValueDistOrNumber, frValueDistOrNumber) +logistic(frValueDistOrNumber, frValueDistOrNumber); ``` **Examples** + ```javascript -gamma(5, 1) +gamma(5, 1); ``` ## To (Distribution) -**Definitions** +**Definitions** + ```javascript -to(frValueDistOrNumber, frValueDistOrNumber) +to(frValueDistOrNumber, frValueDistOrNumber); ``` + ```javascript -credibleIntervalToDistribution(frValueDistOrNumber, frValueDistOrNumber) +credibleIntervalToDistribution(frValueDistOrNumber, frValueDistOrNumber); ``` **Examples** + ```javascript 5 to 10 to(5,10) @@ -122,73 +143,86 @@ to(5,10) ## Exponential -**Definitions** +**Definitions** + ```javascript -exponential(frValueDistOrNumber) +exponential(frValueDistOrNumber); ``` **Examples** + ```javascript -exponential(2) +exponential(2); ``` ## Bernoulli -**Definitions** +**Definitions** + ```javascript -bernoulli(frValueDistOrNumber) +bernoulli(frValueDistOrNumber); ``` **Examples** + ```javascript -bernoulli(0.5) +bernoulli(0.5); ``` ## toContinuousPointSet + Converts a set of points to a continuous distribution -**Definitions** +**Definitions** + ```javascript toContinuousPointSet(array>) ``` **Examples** + ```javascript toContinuousPointSet([ - {x: 0, y: 0.1}, - {x: 1, y: 0.2}, - {x: 2, y: 0.15}, - {x:3, y: 0.1} -]) + { x: 0, y: 0.1 }, + { x: 1, y: 0.2 }, + { x: 2, y: 0.15 }, + { x: 3, y: 0.1 }, +]); ``` ## toDiscretePointSet + Converts a set of points to a discrete distribution -**Definitions** +**Definitions** + ```javascript toDiscretePointSet(array>) ``` **Examples** + ```javascript toDiscretePointSet([ - {x: 0, y: 0.1}, - {x: 1, y: 0.2}, - {x: 2, y: 0.15}, - {x:3, y: 0.1} -]) + { x: 0, y: 0.1 }, + { x: 1, y: 0.2 }, + { x: 2, y: 0.15 }, + { x: 3, y: 0.1 }, +]); ``` ## Declaration (Continuous Function) + Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within. -**Definitions** +**Definitions** + ```javascript declareFn(dict<{fn: lambda, inputs: array>}>) ``` **Examples** + ```javascript declareFn({ fn: {|a,b| a }, @@ -197,4 +231,4 @@ declareFn({ {min: 30, max: 50} ] }) -``` \ No newline at end of file +``` diff --git a/packages/website/docs/Api/Duration.md b/packages/website/docs/Api/Duration.md index c4495dcb..767d9d40 100644 --- a/packages/website/docs/Api/Duration.md +++ b/packages/website/docs/Api/Duration.md @@ -9,86 +9,74 @@ title: Duration (duration):string ``` - ### minutes ```javascript (number):duration ``` - ### hours ```javascript (number):duration ``` - ### days ```javascript (number):duration ``` - ### years ```javascript (number):duration ``` - ### toHours ```javascript (duration):number ``` - ### toMinutes ```javascript (duration):number ``` - ### toDays ```javascript (duration):number ``` - ### toYears ```javascript (duration):number ``` - ### add ```javascript (duration, duration):duration ``` - ### subtract ```javascript (duration, duration):duration ``` - ### multiply ```javascript (duration, duration):duration ``` - ### divide ```javascript (duration, duration):duration -``` \ No newline at end of file +``` diff --git a/packages/website/docs/Api/List.md b/packages/website/docs/Api/List.md index c352f42d..46e1c3a6 100644 --- a/packages/website/docs/Api/List.md +++ b/packages/website/docs/Api/List.md @@ -9,177 +9,152 @@ title: List (list<'a>):string ``` - ### length ```javascript (list<'a>):number ``` - ### get ```javascript (list, number):a ``` - ### find ```javascript (list, e => bool):a ``` - ### filter ```javascript (list, e => bool):a ``` - ### set ```javascript (list, number, a):a ``` - ### shuffle ```javascript (list):list ``` - ### reverse ```javascript (list):list ``` - ### make ```javascript (number,a):list (number, (index:number => a)):list (pointSetDist):list ``` - ### range ```javascript (low:number, high:number) => list ``` - ### rangeBy ```javascript (low:number, high:number, increment: number) => list ``` - ### zip ```javascript (list, list):list> ``` - ### unzip ```javascript (list>):list, list> ``` - ### concat ```javascript (list, list): list ``` - ### concatMany ```javascript (list>):list ``` - ### slice ```javascript ``` - ### map ```javascript (list, (a -> b)): list ``` - ### reduce ```javascript ``` - ### reduceRight ```javascript ``` - ### includes ```javascript (list<'a>, 'a => bool):boolean ``` - ### every ```javascript (list<'a>, 'a => bool):boolean ``` - ### truncate ```javascript (list<'a>, number):list<'a> ``` - ### uniq ```javascript (list<'a>):list ``` - ### first ```javascript (list<'a>):'a ``` - ### last ```javascript (list<'a>):'a ``` - ### sort ```javascript (list<'a>):list -``` \ No newline at end of file +``` diff --git a/packages/website/docs/Api/Math.md b/packages/website/docs/Api/Math.md index 1a52077b..9791b3b7 100644 --- a/packages/website/docs/Api/Math.md +++ b/packages/website/docs/Api/Math.md @@ -4,87 +4,87 @@ title: Math --- ### E + Euler's number; ≈ 2.718281828459045 ```javascript -number +number; ``` - ### LN2 + Natural logarithm of 2; ≈ 0.6931471805599453 ```javascript -number +number; ``` - ### LN10 + Natural logarithm of 10; ≈ 2.302585092994046 ```javascript -number +number; ``` - ### LOG2E + Base 2 logarithm of E; ≈ 1.4426950408889634 ```javascript -number +number; ``` - ### LOG10E + Base 10 logarithm of E; ≈ 0.4342944819032518 ```javascript -number +number; ``` - ### PI + Pi - ratio of the circumference to the diameter of a circle; ≈ 3.141592653589793 ```javascript -number +number; ``` - ### SQRT1_2 + Square root of 1/2; ≈ 0.7071067811865476 ```javascript -number +number; ``` - ### SQRT2 + Square root of 2; ≈ 1.4142135623730951 ```javascript -number +number; ``` - ### PHI + Phi is the golden ratio. 1.618033988749895 ```javascript -number +number; ``` - ### TAU -Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi. 6.283185307179586 + +Tau is the ratio constant of a circle's circumference to radius, equal to 2 \* pi. 6.283185307179586 ```javascript -number +number; ``` - ### Infinity ```javascript -number -``` \ No newline at end of file +number; +``` diff --git a/packages/website/docs/Api/Number.md b/packages/website/docs/Api/Number.md index d8acfe52..66d9599b 100644 --- a/packages/website/docs/Api/Number.md +++ b/packages/website/docs/Api/Number.md @@ -3,191 +3,164 @@ sidebar_position: 6 title: Number --- - ### ceil ```javascript (number): number ``` - ### floor ```javascript (number): number ``` - ### abs ```javascript (number): number ``` - ### round ```javascript (number): number ``` - ### max ```javascript (list): number ``` - ### maxBy ```javascript (list, fn(element)):number ``` - ### min ```javascript (list): number ``` - ### minBy ```javascript (list, fn(element)):number ``` - ### random ```javascript -number +number; ``` - ### randomInt ```javascript -number +number; ``` - ### mean ```javascript (list): number ``` - ### median ```javascript (list): number ``` - ### mode ```javascript (list): number ``` - ### std ```javascript (list): number ``` - ### variance ```javascript (list): number ``` - ### unaryMinus ```javascript (number): number ``` - ### equal ```javascript (number, number): boolean ``` - ### add ```javascript (number, number): number ``` - ### sum ```javascript (number, number): number ``` - ### multiply ```javascript (number, number): number ``` - ### product ```javascript (number, number): number ``` - ### subtract ```javascript (number, number): number ``` - ### divide ```javascript (number, number): number ``` - ### pow ```javascript (number, number): number ``` - ### exp ```javascript (number): number ``` - ### log ```javascript (number, number=Math.e): number ``` - ### log10 ```javascript (number): number -``` \ No newline at end of file +``` diff --git a/packages/website/docs/Api/PointSetDist.md b/packages/website/docs/Api/PointSetDist.md index 9dfe976f..63add6a8 100644 --- a/packages/website/docs/Api/PointSetDist.md +++ b/packages/website/docs/Api/PointSetDist.md @@ -9,16 +9,14 @@ title: Point Set Distribution (list<{x: number, y: number}>): pointSetDist ``` - ### makeDiscrete ```javascript (list<{x: number, y: number}>): pointSetDist ``` - ### map ```javascript (pointSetDist, ({x:number,y:number}=>{x:number,y:number})):pointSetDist -``` \ No newline at end of file +``` diff --git a/packages/website/docs/Api/SampleSetDist.md b/packages/website/docs/Api/SampleSetDist.md index b7553988..4115b26f 100644 --- a/packages/website/docs/Api/SampleSetDist.md +++ b/packages/website/docs/Api/SampleSetDist.md @@ -4,6 +4,7 @@ title: Sample Set Distribution --- ### toInternalSampleArray + Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toInternalSampleArray() maintains order and length. ```javascript @@ -11,8 +12,9 @@ Gets the internal samples of a sampleSet distribution. This is separate from the ``` **Examples** + ```javascript -toInternalSampleArray(toSampleSet(normal(5,2))) +toInternalSampleArray(toSampleSet(normal(5, 2))); ``` ### kde @@ -21,37 +23,32 @@ toInternalSampleArray(toSampleSet(normal(5,2))) (sampleSet):pointSetDist ``` - ### toEmpiricalPdf ```javascript (sampleSet):pointSetDist ``` - ### map ```javascript (sampleSet, (r => number)): sampleSet ``` - ### map2 ```javascript (sampleSet, sampleSet, ((d1, d2)=>number)): sampleSet ``` - ### map3 ```javascript (sampleSet, sampleSet, sampleSet, ((d1, d2, d3)=>number)): sampleSet ``` - ### make ```javascript (dist): sampleSet (()=>number): sampleSet (list): sampleSet -``` \ No newline at end of file +``` From 6567f1b8ef476f3351fbf844ede7e3c7d3531a4d Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sun, 5 Jun 2022 20:02:17 -0700 Subject: [PATCH 06/20] Moved API files to API directory --- .../FunctionRegistry_Library.res | 14 +- .../docs/Api/{Dict.md => Dictionary.md} | 4 +- .../Api/{Distribution.md => DistGeneric.mdx} | 250 +++++++++++++++++- .../Api/{PointSetDist.md => DistPointSet.mdx} | 2 +- packages/website/docs/Api/DistSampleSet.mdx | 67 +++++ .../website/docs/Api/DistributionCreation.md | 234 ---------------- .../docs/Api/{Duration.md => Duration.mdx} | 2 +- packages/website/docs/Api/List.md | 160 ----------- packages/website/docs/Api/List.mdx | 176 ++++++++++++ .../website/docs/Api/{Math.md => Math.mdx} | 2 +- .../docs/Api/{Number.md => Number.mdx} | 2 +- packages/website/docs/Api/SampleSetDist.md | 54 ---- .../website/docs/Guides/Distributions.mdx | 5 +- packages/website/docusaurus.config.js | 6 + packages/website/sidebars.js | 16 +- 15 files changed, 518 insertions(+), 476 deletions(-) rename packages/website/docs/Api/{Dict.md => Dictionary.md} (92%) rename packages/website/docs/Api/{Distribution.md => DistGeneric.mdx} (63%) rename packages/website/docs/Api/{PointSetDist.md => DistPointSet.mdx} (93%) create mode 100644 packages/website/docs/Api/DistSampleSet.mdx delete mode 100644 packages/website/docs/Api/DistributionCreation.md rename packages/website/docs/Api/{Duration.md => Duration.mdx} (97%) delete mode 100644 packages/website/docs/Api/List.md create mode 100644 packages/website/docs/Api/List.mdx rename packages/website/docs/Api/{Math.md => Math.mdx} (97%) rename packages/website/docs/Api/{Number.md => Number.mdx} (98%) delete mode 100644 packages/website/docs/Api/SampleSetDist.md diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res index 33e85492..af364e9c 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Library.res @@ -49,7 +49,7 @@ let inputsTodist = (inputs: array, makeDist) => { let registry = [ Function.make( - ~name="Normal Distribution", + ~name="Normal", ~examples=`normal(5,1) normal({p5: 4, p95: 10}) normal({mean: 5, stdev: 2})`, @@ -63,7 +63,7 @@ normal({mean: 5, stdev: 2})`, (), ), Function.make( - ~name="Lognormal Distribution", + ~name="Lognormal", ~examples=`lognormal(0.5, 0.8) lognormal({p5: 4, p95: 10}) lognormal({mean: 5, stdev: 2})`, @@ -77,31 +77,31 @@ lognormal({mean: 5, stdev: 2})`, (), ), Function.make( - ~name="Uniform Distribution", + ~name="Uniform", ~examples=`uniform(10, 12)`, ~definitions=[TwoArgDist.make("uniform", twoArgs(SymbolicDist.Uniform.make))], (), ), Function.make( - ~name="Beta Distribution", + ~name="Beta", ~examples=`beta(20, 25)`, ~definitions=[TwoArgDist.make("beta", twoArgs(SymbolicDist.Beta.make))], (), ), Function.make( - ~name="Cauchy Distribution", + ~name="Cauchy", ~examples=`cauchy(5, 1)`, ~definitions=[TwoArgDist.make("cauchy", twoArgs(SymbolicDist.Cauchy.make))], (), ), Function.make( - ~name="Gamma Distribution", + ~name="Gamma", ~examples=`gamma(5, 1)`, ~definitions=[TwoArgDist.make("gamma", twoArgs(SymbolicDist.Gamma.make))], (), ), Function.make( - ~name="Logistic Distribution", + ~name="Logistic", ~examples=`gamma(5, 1)`, ~definitions=[TwoArgDist.make("logistic", twoArgs(SymbolicDist.Logistic.make))], (), diff --git a/packages/website/docs/Api/Dict.md b/packages/website/docs/Api/Dictionary.md similarity index 92% rename from packages/website/docs/Api/Dict.md rename to packages/website/docs/Api/Dictionary.md index c2716fa5..0bf0d070 100644 --- a/packages/website/docs/Api/Dict.md +++ b/packages/website/docs/Api/Dictionary.md @@ -1,6 +1,6 @@ --- -sidebar_position: 9 -title: Dict +sidebar_position: 1 +title: Dictionary --- ### toString diff --git a/packages/website/docs/Api/Distribution.md b/packages/website/docs/Api/DistGeneric.mdx similarity index 63% rename from packages/website/docs/Api/Distribution.md rename to packages/website/docs/Api/DistGeneric.mdx index e3184305..ddbd8de3 100644 --- a/packages/website/docs/Api/Distribution.md +++ b/packages/website/docs/Api/DistGeneric.mdx @@ -2,8 +2,244 @@ sidebar_position: 2 title: Distribution --- +import TOCInline from '@theme/TOCInline'; + + + +## Creation + +### Normal Distribution + +**Definitions** + +```javascript +normal(frValueDistOrNumber, frValueDistOrNumber); +``` + +```javascript +normal(dict<{p5: frValueDistOrNumber, p95: frValueDistOrNumber}>) +``` + +```javascript +normal(dict<{mean: frValueDistOrNumber, stdev: frValueDistOrNumber}>) +``` + +**Examples** + +```javascript +normal(5, 1); +normal({ p5: 4, p95: 10 }); +normal({ mean: 5, stdev: 2 }); +``` + +### Lognormal Distribution + +**Definitions** + +```javascript +lognormal(frValueDistOrNumber, frValueDistOrNumber); +``` + +```javascript +lognormal(dict<{p5: frValueDistOrNumber, p95: frValueDistOrNumber}>) +``` + +```javascript +lognormal(dict<{mean: frValueDistOrNumber, stdev: frValueDistOrNumber}>) +``` + +**Examples** + +```javascript +lognormal(0.5, 0.8); +lognormal({ p5: 4, p95: 10 }); +lognormal({ mean: 5, stdev: 2 }); +``` + +### Uniform Distribution + +**Definitions** + +```javascript +uniform(frValueDistOrNumber, frValueDistOrNumber); +``` + +**Examples** + +```javascript +uniform(10, 12); +``` + +### Beta Distribution + +**Definitions** + +```javascript +beta(frValueDistOrNumber, frValueDistOrNumber); +``` + +**Examples** + +```javascript +beta(20, 25); +``` + +### Cauchy Distribution + +**Definitions** + +```javascript +cauchy(frValueDistOrNumber, frValueDistOrNumber); +``` + +**Examples** + +```javascript +cauchy(5, 1); +``` + +### Gamma Distribution + +**Definitions** + +```javascript +gamma(frValueDistOrNumber, frValueDistOrNumber); +``` + +**Examples** + +```javascript +gamma(5, 1); +``` + +### Logistic Distribution + +**Definitions** + +```javascript +logistic(frValueDistOrNumber, frValueDistOrNumber); +``` + +**Examples** + +```javascript +gamma(5, 1); +``` + +### To (Distribution) + +**Definitions** + +```javascript +to(frValueDistOrNumber, frValueDistOrNumber); +``` + +```javascript +credibleIntervalToDistribution(frValueDistOrNumber, frValueDistOrNumber); +``` + +**Examples** + +```javascript +5 to 10 +to(5,10) +-5 to 5 +``` + +### Exponential + +**Definitions** + +```javascript +exponential(frValueDistOrNumber); +``` + +**Examples** + +```javascript +exponential(2); +``` + +### Bernoulli + +**Definitions** + +```javascript +bernoulli(frValueDistOrNumber); +``` + +**Examples** + +```javascript +bernoulli(0.5); +``` + +### toContinuousPointSet + +Converts a set of points to a continuous distribution + +**Definitions** + +```javascript +toContinuousPointSet(array>) +``` + +**Examples** + +```javascript +toContinuousPointSet([ + { x: 0, y: 0.1 }, + { x: 1, y: 0.2 }, + { x: 2, y: 0.15 }, + { x: 3, y: 0.1 }, +]); +``` + +### toDiscretePointSet + +Converts a set of points to a discrete distribution + +**Definitions** + +```javascript +toDiscretePointSet(array>) +``` + +**Examples** + +```javascript +toDiscretePointSet([ + { x: 0, y: 0.1 }, + { x: 1, y: 0.2 }, + { x: 2, y: 0.15 }, + { x: 3, y: 0.1 }, +]); +``` + +### Declaration (Continuous Function) + +Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within. + +**Definitions** + +```javascript +declareFn(dict<{fn: lambda, inputs: array>}>) +``` + +**Examples** + +```javascript +declareFn({ + fn: {|a,b| a }, + inputs: [ + {min: 0, max: 100}, + {min: 30, max: 50} + ] +}) +``` + +## Functions -## Main ### mixture @@ -181,6 +417,8 @@ Truncates the right side of a distribution. Returns either a pointSet distributi truncateLeft(normal(5, 2), 6); ``` +## Scoring + ### klDivergence Kullback–Leibler divergence between two distributions @@ -207,6 +445,8 @@ klDivergence(normal(5, 2), normal(5, 4)); // returns 0.57 logScore({ estimate: normal(5, 2), prior: normal(5.5, 4), answer: 2.3 }); ``` +## Display + ### toString ```javascript @@ -247,6 +487,8 @@ Prints the value of the distribution to the Javascript console, then returns the inspect(normal(5, 2)); ``` +## Normalization + ### normalize Normalize a distribution. This means scaling it appropriately so that it's cumulative sum is equal to 1. @@ -289,6 +531,8 @@ Get the sum of the integral of a distribution. If the distribution is normalized integralSum(normal(5, 2)); ``` +## Algebra1 + ### add ```javascript @@ -355,6 +599,8 @@ integralSum(normal(5, 2)); (distribution):distribution ``` +## Algebra2 + ### dotAdd ```javascript @@ -403,6 +649,8 @@ integralSum(normal(5, 2)); (distributionLike, distributionLike): distribution ``` +## Algebra3 + ### scaleMultiply ```javascript diff --git a/packages/website/docs/Api/PointSetDist.md b/packages/website/docs/Api/DistPointSet.mdx similarity index 93% rename from packages/website/docs/Api/PointSetDist.md rename to packages/website/docs/Api/DistPointSet.mdx index 63add6a8..01580a78 100644 --- a/packages/website/docs/Api/PointSetDist.md +++ b/packages/website/docs/Api/DistPointSet.mdx @@ -1,5 +1,5 @@ --- -sidebar_position: 7 +sidebar_position: 3 title: Point Set Distribution --- diff --git a/packages/website/docs/Api/DistSampleSet.mdx b/packages/website/docs/Api/DistSampleSet.mdx new file mode 100644 index 00000000..282d5d64 --- /dev/null +++ b/packages/website/docs/Api/DistSampleSet.mdx @@ -0,0 +1,67 @@ +--- +sidebar_position: 4 +title: Sample Set Distribution +--- + +### make +```javascript +make: (distribution) => sampleSet +make: (() => number) => sampleSet +make: (list) => sampleSet +``` + + + +### kde +```javascript +kde: (sampleSet) => pointSetDist +``` + + + +### toEmpiricalPdf +```javascript +toEmpiricalPdf: (sampleSet) => pointSetDist +``` + + + +### map +```javascript +map: (sampleSet, (number => number)) => sampleSet +``` + + + +### map2 +```javascript +map2: (sampleSet, sampleSet, ((number, number) => number)) => sampleSet +``` + + + +### map3 +```javascript +map3: (sampleSet, sampleSet, sampleSet, ((number, number, number) => number)) => sampleSet +``` + + + +### correlation +```javascript +correlation: (sampleSet, sampleSet) => number +``` + + + +### toInternalSampleArray +```javascript +toInternalSampleArray: (sampleSet) => list +``` +Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toInternalSampleArray() maintains order and length. + + +**Examples** +```javascript +toInternalSampleArray(toSampleSet(normal(5,2))) +``` \ No newline at end of file diff --git a/packages/website/docs/Api/DistributionCreation.md b/packages/website/docs/Api/DistributionCreation.md deleted file mode 100644 index 6663d878..00000000 --- a/packages/website/docs/Api/DistributionCreation.md +++ /dev/null @@ -1,234 +0,0 @@ ---- -sidebar_position: 1 -title: Distribution Creation ---- - -## Normal Distribution - -**Definitions** - -```javascript -normal(frValueDistOrNumber, frValueDistOrNumber); -``` - -```javascript -normal(dict<{p5: frValueDistOrNumber, p95: frValueDistOrNumber}>) -``` - -```javascript -normal(dict<{mean: frValueDistOrNumber, stdev: frValueDistOrNumber}>) -``` - -**Examples** - -```javascript -normal(5, 1); -normal({ p5: 4, p95: 10 }); -normal({ mean: 5, stdev: 2 }); -``` - -## Lognormal Distribution - -**Definitions** - -```javascript -lognormal(frValueDistOrNumber, frValueDistOrNumber); -``` - -```javascript -lognormal(dict<{p5: frValueDistOrNumber, p95: frValueDistOrNumber}>) -``` - -```javascript -lognormal(dict<{mean: frValueDistOrNumber, stdev: frValueDistOrNumber}>) -``` - -**Examples** - -```javascript -lognormal(0.5, 0.8); -lognormal({ p5: 4, p95: 10 }); -lognormal({ mean: 5, stdev: 2 }); -``` - -## Uniform Distribution - -**Definitions** - -```javascript -uniform(frValueDistOrNumber, frValueDistOrNumber); -``` - -**Examples** - -```javascript -uniform(10, 12); -``` - -## Beta Distribution - -**Definitions** - -```javascript -beta(frValueDistOrNumber, frValueDistOrNumber); -``` - -**Examples** - -```javascript -beta(20, 25); -``` - -## Cauchy Distribution - -**Definitions** - -```javascript -cauchy(frValueDistOrNumber, frValueDistOrNumber); -``` - -**Examples** - -```javascript -cauchy(5, 1); -``` - -## Gamma Distribution - -**Definitions** - -```javascript -gamma(frValueDistOrNumber, frValueDistOrNumber); -``` - -**Examples** - -```javascript -gamma(5, 1); -``` - -## Logistic Distribution - -**Definitions** - -```javascript -logistic(frValueDistOrNumber, frValueDistOrNumber); -``` - -**Examples** - -```javascript -gamma(5, 1); -``` - -## To (Distribution) - -**Definitions** - -```javascript -to(frValueDistOrNumber, frValueDistOrNumber); -``` - -```javascript -credibleIntervalToDistribution(frValueDistOrNumber, frValueDistOrNumber); -``` - -**Examples** - -```javascript -5 to 10 -to(5,10) --5 to 5 -``` - -## Exponential - -**Definitions** - -```javascript -exponential(frValueDistOrNumber); -``` - -**Examples** - -```javascript -exponential(2); -``` - -## Bernoulli - -**Definitions** - -```javascript -bernoulli(frValueDistOrNumber); -``` - -**Examples** - -```javascript -bernoulli(0.5); -``` - -## toContinuousPointSet - -Converts a set of points to a continuous distribution - -**Definitions** - -```javascript -toContinuousPointSet(array>) -``` - -**Examples** - -```javascript -toContinuousPointSet([ - { x: 0, y: 0.1 }, - { x: 1, y: 0.2 }, - { x: 2, y: 0.15 }, - { x: 3, y: 0.1 }, -]); -``` - -## toDiscretePointSet - -Converts a set of points to a discrete distribution - -**Definitions** - -```javascript -toDiscretePointSet(array>) -``` - -**Examples** - -```javascript -toDiscretePointSet([ - { x: 0, y: 0.1 }, - { x: 1, y: 0.2 }, - { x: 2, y: 0.15 }, - { x: 3, y: 0.1 }, -]); -``` - -## Declaration (Continuous Function) - -Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within. - -**Definitions** - -```javascript -declareFn(dict<{fn: lambda, inputs: array>}>) -``` - -**Examples** - -```javascript -declareFn({ - fn: {|a,b| a }, - inputs: [ - {min: 0, max: 100}, - {min: 30, max: 50} - ] -}) -``` diff --git a/packages/website/docs/Api/Duration.md b/packages/website/docs/Api/Duration.mdx similarity index 97% rename from packages/website/docs/Api/Duration.md rename to packages/website/docs/Api/Duration.mdx index 767d9d40..a64ca14b 100644 --- a/packages/website/docs/Api/Duration.md +++ b/packages/website/docs/Api/Duration.mdx @@ -1,5 +1,5 @@ --- -sidebar_position: 10 +sidebar_position: 5 title: Duration --- diff --git a/packages/website/docs/Api/List.md b/packages/website/docs/Api/List.md deleted file mode 100644 index 46e1c3a6..00000000 --- a/packages/website/docs/Api/List.md +++ /dev/null @@ -1,160 +0,0 @@ ---- -sidebar_position: 4 -title: List ---- - -### toString - -```javascript -(list<'a>):string -``` - -### length - -```javascript -(list<'a>):number -``` - -### get - -```javascript -(list, number):a -``` - -### find - -```javascript -(list, e => bool):a -``` - -### filter - -```javascript -(list, e => bool):a -``` - -### set - -```javascript -(list, number, a):a -``` - -### shuffle - -```javascript -(list):list -``` - -### reverse - -```javascript -(list):list -``` - -### make - -```javascript -(number,a):list (number, (index:number => a)):list (pointSetDist):list -``` - -### range - -```javascript -(low:number, high:number) => list -``` - -### rangeBy - -```javascript -(low:number, high:number, increment: number) => list -``` - -### zip - -```javascript -(list, list):list> -``` - -### unzip - -```javascript -(list>):list, list> -``` - -### concat - -```javascript -(list, list): list -``` - -### concatMany - -```javascript -(list>):list -``` - -### slice - -```javascript - -``` - -### map - -```javascript -(list, (a -> b)): list -``` - -### reduce - -```javascript - -``` - -### reduceRight - -```javascript - -``` - -### includes - -```javascript -(list<'a>, 'a => bool):boolean -``` - -### every - -```javascript -(list<'a>, 'a => bool):boolean -``` - -### truncate - -```javascript -(list<'a>, number):list<'a> -``` - -### uniq - -```javascript -(list<'a>):list -``` - -### first - -```javascript -(list<'a>):'a -``` - -### last - -```javascript -(list<'a>):'a -``` - -### sort - -```javascript -(list<'a>):list -``` diff --git a/packages/website/docs/Api/List.mdx b/packages/website/docs/Api/List.mdx new file mode 100644 index 00000000..9fb5f326 --- /dev/null +++ b/packages/website/docs/Api/List.mdx @@ -0,0 +1,176 @@ +--- +sidebar_position: 6 +title: List +--- + +### make +```javascript +make: (number, 'a) => list<'a> (number, number => a) => list<'a> (pointSetDist) => list +``` + + + +### toString +```typescript +toString: (list<'a>) => string +``` + + + +### length +```typescript +length: (list<'a>) => number +``` + + + +### get +```typescript +get: (list<'a>, number) => 'a +``` + + + +### find +```typescript +find: (list<'a>, 'a => bool) => 'a +``` + + + +### filter +```typescript +filter: (list<'a>, 'a => bool) => 'a +``` + + + +### set +```typescript +set: (list<'a>, number, 'a) => 'a +``` + + + +### shuffle +```typescript +shuffle: (list<'a>) => list<'a> +``` + + + +### reverse +```typescript +reverse: (list<'a>) => list<'a> +``` + + + +### range +```typescript +range: (low:number, high:number, increment?:number=1.0) => list +``` + + + +### zip +```typescript +zip: (list<'a>, list<'b>) => list> +``` + + + +### unzip +```typescript +unzip: (list>) => list, list<'b>> +``` + + + +### concat +```typescript +concat: (list<'a>, list<'b>) => list<'a|b> +``` + + + +### concatMany +```typescript +concatMany: (list>) => list<'a> +``` + + + +### slice +```typescript +slice: +``` + + + +### map +```typescript +map: (list<'a>, a => b) => list<'b> +``` + + + +### reduce +```typescript +reduce: +``` + + +### reduceRight +```typescript +reduceRight: +``` + + + +### includes +```typescript +includes: (list<'a>, 'a => bool) => boolean +``` + + + +### every +```typescript +every: (list<'a>, 'a => bool) => boolean +``` + + + +### truncate +```typescript +truncate: (list<'a>, number) => list<'a> +``` + + + +### uniq +```typescript +uniq: (list<'a>) => list<'a> +``` + + + +### first +```typescript +first: (list<'a>) => 'a +``` + + + +### last +```typescript +last: (list<'a>) => 'a +``` + + + +### sort +```typescript +sort: (list<'a>) => list<'a> +``` \ No newline at end of file diff --git a/packages/website/docs/Api/Math.md b/packages/website/docs/Api/Math.mdx similarity index 97% rename from packages/website/docs/Api/Math.md rename to packages/website/docs/Api/Math.mdx index 9791b3b7..1b9b1c15 100644 --- a/packages/website/docs/Api/Math.md +++ b/packages/website/docs/Api/Math.mdx @@ -1,5 +1,5 @@ --- -sidebar_position: 5 +sidebar_position: 7 title: Math --- diff --git a/packages/website/docs/Api/Number.md b/packages/website/docs/Api/Number.mdx similarity index 98% rename from packages/website/docs/Api/Number.md rename to packages/website/docs/Api/Number.mdx index 66d9599b..ace6fd2f 100644 --- a/packages/website/docs/Api/Number.md +++ b/packages/website/docs/Api/Number.mdx @@ -1,5 +1,5 @@ --- -sidebar_position: 6 +sidebar_position: 8 title: Number --- diff --git a/packages/website/docs/Api/SampleSetDist.md b/packages/website/docs/Api/SampleSetDist.md deleted file mode 100644 index 4115b26f..00000000 --- a/packages/website/docs/Api/SampleSetDist.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -sidebar_position: 8 -title: Sample Set Distribution ---- - -### toInternalSampleArray - -Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toInternalSampleArray() maintains order and length. - -```javascript -(sampleSet):list -``` - -**Examples** - -```javascript -toInternalSampleArray(toSampleSet(normal(5, 2))); -``` - -### kde - -```javascript -(sampleSet):pointSetDist -``` - -### toEmpiricalPdf - -```javascript -(sampleSet):pointSetDist -``` - -### map - -```javascript -(sampleSet, (r => number)): sampleSet -``` - -### map2 - -```javascript -(sampleSet, sampleSet, ((d1, d2)=>number)): sampleSet -``` - -### map3 - -```javascript -(sampleSet, sampleSet, sampleSet, ((d1, d2, d3)=>number)): sampleSet -``` - -### make - -```javascript -(dist): sampleSet (()=>number): sampleSet (list): sampleSet -``` diff --git a/packages/website/docs/Guides/Distributions.mdx b/packages/website/docs/Guides/Distributions.mdx index 6cc5967d..2688f398 100644 --- a/packages/website/docs/Guides/Distributions.mdx +++ b/packages/website/docs/Guides/Distributions.mdx @@ -1,16 +1,13 @@ --- title: "Distribution Creation" -sidebar_position: 2 +sidebar_position: 20 --- -import TOCInline from "@theme/TOCInline"; import { SquiggleEditor } from "../../src/components/SquiggleEditor"; import Admonition from "@theme/Admonition"; import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; - - ## To `(5thPercentile: number) to (95thPercentile: number)` diff --git a/packages/website/docusaurus.config.js b/packages/website/docusaurus.config.js index 68d440c8..e53161e7 100644 --- a/packages/website/docusaurus.config.js +++ b/packages/website/docusaurus.config.js @@ -82,6 +82,12 @@ const config = { position: "left", label: "Documentation", }, + { + type: "doc", + docId: "Api/Dictionary", + position: "left", + label: "API", + }, { to: "/blog", label: "Blog", position: "left" }, { to: "/playground", label: "Playground", position: "left" }, { diff --git a/packages/website/sidebars.js b/packages/website/sidebars.js index 5db00f6c..55b9b1a6 100644 --- a/packages/website/sidebars.js +++ b/packages/website/sidebars.js @@ -14,6 +14,12 @@ /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { // By default, Docusaurus generates a sidebar from the docs folder structure + apiSidebar: [ + { + type: 'autogenerated', + dirName: 'Api', + }, + ], tutorialSidebar: [ { type: "doc", @@ -30,16 +36,6 @@ const sidebars = { }, ], }, - { - type: "category", - label: "API", - items: [ - { - type: "autogenerated", - dirName: "Api", - }, - ], - }, { type: "category", label: "Discussions", From 441ac3c251560299591d98e57c2a18f13216fb08 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sun, 5 Jun 2022 21:47:29 -0700 Subject: [PATCH 07/20] Changed the name of select functions --- .../Reducer_Dispatch_BuiltIn.res | 6 +- .../Api/{DistPointSet.mdx => DistPointSet.md} | 0 packages/website/docs/Api/DistSampleSet.md | 67 +++++++ packages/website/docs/Api/DistSampleSet.mdx | 67 ------- .../docs/Api/{Duration.mdx => Duration.md} | 0 packages/website/docs/Api/List.md | 179 ++++++++++++++++++ packages/website/docs/Api/List.mdx | 176 ----------------- .../website/docs/Api/{Math.mdx => Math.md} | 0 .../docs/Api/{Number.mdx => Number.md} | 0 9 files changed, 249 insertions(+), 246 deletions(-) rename packages/website/docs/Api/{DistPointSet.mdx => DistPointSet.md} (100%) create mode 100644 packages/website/docs/Api/DistSampleSet.md delete mode 100644 packages/website/docs/Api/DistSampleSet.mdx rename packages/website/docs/Api/{Duration.mdx => Duration.md} (100%) create mode 100644 packages/website/docs/Api/List.md delete mode 100644 packages/website/docs/Api/List.mdx rename packages/website/docs/Api/{Math.mdx => Math.md} (100%) rename packages/website/docs/Api/{Number.mdx => Number.md} (100%) diff --git a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res index 218aa673..c39ff118 100644 --- a/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res +++ b/packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn.res @@ -281,12 +281,12 @@ let callInternal = (call: functionCall, environment, reducer: ExpressionT.reduce | ("$_typeModifier_opaque_$", [EvRecord(typeRecord)]) => typeModifier_opaque_update(typeRecord) | ("$_typeOr_$", [EvArray(arr)]) => typeOr(EvArray(arr)) | ("$_typeFunction_$", [EvArray(arr)]) => typeFunction(arr) - | ("add", [EvArray(aValueArray), EvArray(bValueArray)]) => doAddArray(aValueArray, bValueArray) - | ("add", [EvString(aValueString), EvString(bValueString)]) => + | ("concat", [EvArray(aValueArray), EvArray(bValueArray)]) => doAddArray(aValueArray, bValueArray) + | ("concat", [EvString(aValueString), EvString(bValueString)]) => doAddString(aValueString, bValueString) | ("inspect", [value, EvString(label)]) => inspectLabel(value, label) | ("inspect", [value]) => inspect(value) - | ("keep", [EvArray(aValueArray), EvLambda(aLambdaValue)]) => + | ("filter", [EvArray(aValueArray), EvLambda(aLambdaValue)]) => doKeepArray(aValueArray, aLambdaValue) | ("map", [EvArray(aValueArray), EvLambda(aLambdaValue)]) => doMapArray(aValueArray, aLambdaValue) | ("mapSamples", [EvDistribution(SampleSet(dist)), EvLambda(aLambdaValue)]) => diff --git a/packages/website/docs/Api/DistPointSet.mdx b/packages/website/docs/Api/DistPointSet.md similarity index 100% rename from packages/website/docs/Api/DistPointSet.mdx rename to packages/website/docs/Api/DistPointSet.md diff --git a/packages/website/docs/Api/DistSampleSet.md b/packages/website/docs/Api/DistSampleSet.md new file mode 100644 index 00000000..b9a722d4 --- /dev/null +++ b/packages/website/docs/Api/DistSampleSet.md @@ -0,0 +1,67 @@ +--- +sidebar_position: 4 +title: Sample Set Distribution +--- + +### make +``` +SampleSet.make: (distribution) => sampleSet +SampleSet.make: (() => number) => sampleSet +SampleSet.make: (list) => sampleSet +``` + + + +### kde +``` +SampleSet.kde: (sampleSet) => pointSetDist +``` + + + +### toEmpiricalPdf +``` +SampleSet.toEmpiricalPdf: (sampleSet) => pointSetDist +``` + + + +### map +``` +SampleSet.map: (sampleSet, (number => number)) => sampleSet +``` + + + +### map2 +``` +SampleSet.map2: (sampleSet, sampleSet, ((number, number) => number)) => sampleSet +``` + + + +### map3 +``` +SampleSet.map3: (sampleSet, sampleSet, sampleSet, ((number, number, number) => number)) => sampleSet +``` + + + +### correlation +``` +SampleSet.correlation: (sampleSet, sampleSet) => number +``` + + + +### toInternalSampleArray +``` +SampleSet.toInternalSampleArray: (sampleSet) => list +``` +Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toInternalSampleArray() maintains order and length.Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toInternalSampleArray() maintains order and length. + + +**Examples** +``` +toInternalSampleArray(toSampleSet(normal(5,2))) +``` \ No newline at end of file diff --git a/packages/website/docs/Api/DistSampleSet.mdx b/packages/website/docs/Api/DistSampleSet.mdx deleted file mode 100644 index 282d5d64..00000000 --- a/packages/website/docs/Api/DistSampleSet.mdx +++ /dev/null @@ -1,67 +0,0 @@ ---- -sidebar_position: 4 -title: Sample Set Distribution ---- - -### make -```javascript -make: (distribution) => sampleSet -make: (() => number) => sampleSet -make: (list) => sampleSet -``` - - - -### kde -```javascript -kde: (sampleSet) => pointSetDist -``` - - - -### toEmpiricalPdf -```javascript -toEmpiricalPdf: (sampleSet) => pointSetDist -``` - - - -### map -```javascript -map: (sampleSet, (number => number)) => sampleSet -``` - - - -### map2 -```javascript -map2: (sampleSet, sampleSet, ((number, number) => number)) => sampleSet -``` - - - -### map3 -```javascript -map3: (sampleSet, sampleSet, sampleSet, ((number, number, number) => number)) => sampleSet -``` - - - -### correlation -```javascript -correlation: (sampleSet, sampleSet) => number -``` - - - -### toInternalSampleArray -```javascript -toInternalSampleArray: (sampleSet) => list -``` -Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toInternalSampleArray() maintains order and length. - - -**Examples** -```javascript -toInternalSampleArray(toSampleSet(normal(5,2))) -``` \ No newline at end of file diff --git a/packages/website/docs/Api/Duration.mdx b/packages/website/docs/Api/Duration.md similarity index 100% rename from packages/website/docs/Api/Duration.mdx rename to packages/website/docs/Api/Duration.md diff --git a/packages/website/docs/Api/List.md b/packages/website/docs/Api/List.md new file mode 100644 index 00000000..ef2e537e --- /dev/null +++ b/packages/website/docs/Api/List.md @@ -0,0 +1,179 @@ +--- +sidebar_position: 6 +title: List +--- + +## make +``` +List.make: (number, 'a) => list<'a> +List.make: (number, number => a) => list<'a> +List.make: (pointSetDist) => list +``` + + + +### toString +``` +List.toString: (list<'a>) => string +``` + + + +### length +``` +List.length: (list<'a>) => number +``` + + + +### get +``` +List.get: (list<'a>, number) => 'a +``` + + + +### find +``` +List.find: (list<'a>, 'a => bool) => 'a +``` + + + +### filter +``` +List.filter: (list<'a>, 'a => bool) => 'a +``` + + + +### set +``` +List.set: (list<'a>, number, 'a) => 'a +``` + + + +### shuffle +``` +List.shuffle: (list<'a>) => list<'a> +``` + + + +### reverse +``` +List.reverse: (list<'a>) => list<'a> +``` + + + +### range +``` +List.range: (low:number, high:number, increment?:number=1.0) => list +``` + + + +### zip +``` +List.zip: (list<'a>, list<'b>) => list> +``` + + + +### unzip +``` +List.unzip: (list>) => list, list<'b>> +``` + + + +### concat +``` +List.concat: (list<'a>, list<'b>) => list<'a|b> +``` + + + +### concatMany +``` +List.concatMany: (list>) => list<'a> +``` + + + +### slice +``` +List.slice: +``` + + + +### map +``` +List.map: (list<'a>, a => b) => list<'b> +``` + + + +### reduce +``` +List.reduce: +``` + + + +### reduceRight +``` +List.reduceRight: +``` + + + +### includes +``` +List.includes: (list<'a>, 'a => bool) => boolean +``` + + + +### every +``` +List.every: (list<'a>, 'a => bool) => boolean +``` + + + +### truncate +``` +List.truncate: (list<'a>, number) => list<'a> +``` + + + +### uniq +``` +List.uniq: (list<'a>) => list<'a> +``` + + + +### first +``` +List.first: (list<'a>) => 'a +``` + + + +### last +``` +List.last: (list<'a>) => 'a +``` + + + +### sort +``` +List.sort: (list<'a>) => list<'a> +``` \ No newline at end of file diff --git a/packages/website/docs/Api/List.mdx b/packages/website/docs/Api/List.mdx deleted file mode 100644 index 9fb5f326..00000000 --- a/packages/website/docs/Api/List.mdx +++ /dev/null @@ -1,176 +0,0 @@ ---- -sidebar_position: 6 -title: List ---- - -### make -```javascript -make: (number, 'a) => list<'a> (number, number => a) => list<'a> (pointSetDist) => list -``` - - - -### toString -```typescript -toString: (list<'a>) => string -``` - - - -### length -```typescript -length: (list<'a>) => number -``` - - - -### get -```typescript -get: (list<'a>, number) => 'a -``` - - - -### find -```typescript -find: (list<'a>, 'a => bool) => 'a -``` - - - -### filter -```typescript -filter: (list<'a>, 'a => bool) => 'a -``` - - - -### set -```typescript -set: (list<'a>, number, 'a) => 'a -``` - - - -### shuffle -```typescript -shuffle: (list<'a>) => list<'a> -``` - - - -### reverse -```typescript -reverse: (list<'a>) => list<'a> -``` - - - -### range -```typescript -range: (low:number, high:number, increment?:number=1.0) => list -``` - - - -### zip -```typescript -zip: (list<'a>, list<'b>) => list> -``` - - - -### unzip -```typescript -unzip: (list>) => list, list<'b>> -``` - - - -### concat -```typescript -concat: (list<'a>, list<'b>) => list<'a|b> -``` - - - -### concatMany -```typescript -concatMany: (list>) => list<'a> -``` - - - -### slice -```typescript -slice: -``` - - - -### map -```typescript -map: (list<'a>, a => b) => list<'b> -``` - - - -### reduce -```typescript -reduce: -``` - - -### reduceRight -```typescript -reduceRight: -``` - - - -### includes -```typescript -includes: (list<'a>, 'a => bool) => boolean -``` - - - -### every -```typescript -every: (list<'a>, 'a => bool) => boolean -``` - - - -### truncate -```typescript -truncate: (list<'a>, number) => list<'a> -``` - - - -### uniq -```typescript -uniq: (list<'a>) => list<'a> -``` - - - -### first -```typescript -first: (list<'a>) => 'a -``` - - - -### last -```typescript -last: (list<'a>) => 'a -``` - - - -### sort -```typescript -sort: (list<'a>) => list<'a> -``` \ No newline at end of file diff --git a/packages/website/docs/Api/Math.mdx b/packages/website/docs/Api/Math.md similarity index 100% rename from packages/website/docs/Api/Math.mdx rename to packages/website/docs/Api/Math.md diff --git a/packages/website/docs/Api/Number.mdx b/packages/website/docs/Api/Number.md similarity index 100% rename from packages/website/docs/Api/Number.mdx rename to packages/website/docs/Api/Number.md From 18c14089c6e105db0cfcd86e0923c99ce38f0702 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sun, 5 Jun 2022 22:16:29 -0700 Subject: [PATCH 08/20] Updated a few of the API pages --- packages/website/docs/Api/Dictionary.md | 54 ++++++----- packages/website/docs/Api/DistPointSet.md | 28 +++--- packages/website/docs/Api/Duration.md | 89 ++++++++++-------- packages/website/docs/Api/Math.md | 105 +++++++++++----------- 4 files changed, 150 insertions(+), 126 deletions(-) diff --git a/packages/website/docs/Api/Dictionary.md b/packages/website/docs/Api/Dictionary.md index 0bf0d070..162fbdd8 100644 --- a/packages/website/docs/Api/Dictionary.md +++ b/packages/website/docs/Api/Dictionary.md @@ -4,49 +4,55 @@ title: Dictionary --- ### toString - -```javascript -(dict):string ``` +toString: (dict<'a>) => string +``` + + ### get - -```javascript -(dict, string):a ``` +Dict.get: (dict<'a>, string) => a +``` + + ### set - -```javascript -(dict, string, a):a ``` +Dict.set: (dict<'a>, string, a) => a +``` + + ### toPairs - -```javascript -(dict):list> ``` +Dict.toPairs: (dict<'a>) => list> +``` + + ### keys - -```javascript -(dict):list ``` +Dict.keys: (dict<'a>) => list +``` + + ### values - -```javascript -(dict):list ``` +Dict.values: (dict<'a>) => list<'a> +``` + + ### merge - -```javascript -(dict, dict):dict ``` +Dict.merge: (dict<'a>, dict<'b>) => dict<'a|b> +``` + + ### mergeMany - -```javascript -(list>):dict ``` +Dict.mergeMany: (list>) => dict<'a> +``` \ No newline at end of file diff --git a/packages/website/docs/Api/DistPointSet.md b/packages/website/docs/Api/DistPointSet.md index 01580a78..0b638d88 100644 --- a/packages/website/docs/Api/DistPointSet.md +++ b/packages/website/docs/Api/DistPointSet.md @@ -3,20 +3,28 @@ sidebar_position: 3 title: Point Set Distribution --- -### makeContinuous - -```javascript -(list<{x: number, y: number}>): pointSetDist +### make ``` +PointSet.make: (distribution) => pointSetDist +``` + + + +### makeContinuous +``` +PointSet.makeContinuous: (list<{x: number, y: number}>) => pointSetDist +``` + + ### makeDiscrete - -```javascript -(list<{x: number, y: number}>): pointSetDist +``` +PointSet.makeDiscrete: (list<{x: number, y: number}>) => pointSetDist ``` -### map -```javascript -(pointSetDist, ({x:number,y:number}=>{x:number,y:number})):pointSetDist + +### mapPoints ``` +PointSet.mapPoints: (pointSetDist, ({x:number, y:number} => {x:number, y:number})) => pointSetDist +``` \ No newline at end of file diff --git a/packages/website/docs/Api/Duration.md b/packages/website/docs/Api/Duration.md index a64ca14b..a2af98d0 100644 --- a/packages/website/docs/Api/Duration.md +++ b/packages/website/docs/Api/Duration.md @@ -4,79 +4,90 @@ title: Duration --- ### toString - -```javascript -(duration):string ``` +toString: (duration) => string +``` + + ### minutes - -```javascript -(number):duration ``` +minutes: (number) => duration +``` + + ### hours - -```javascript -(number):duration ``` +hours: (number) => duration +``` + + ### days - -```javascript -(number):duration ``` +days: (number) => duration +``` + + ### years - -```javascript -(number):duration ``` +years: (number) => duration +``` + + ### toHours - -```javascript -(duration):number ``` +Duration.toHours: (duration) => number +``` + + ### toMinutes - -```javascript -(duration):number ``` +Duration.toMinutes: (duration) => number +``` + + ### toDays - -```javascript -(duration):number ``` +Duration.toDays: (duration) => number +``` + + ### toYears - -```javascript -(duration):number ``` +Duration.toYears: (duration) => number +``` + + ### add - -```javascript -(duration, duration):duration ``` +add: (duration, duration) => duration +``` + + ### subtract - -```javascript -(duration, duration):duration ``` +subtract: (duration, duration) => duration +``` + + ### multiply - -```javascript -(duration, duration):duration ``` +multiply: (duration, duration) => duration +``` + + ### divide - -```javascript -(duration, duration):duration +``` +divide: (duration, duration) => duration ``` diff --git a/packages/website/docs/Api/Math.md b/packages/website/docs/Api/Math.md index 1b9b1c15..fa8a65df 100644 --- a/packages/website/docs/Api/Math.md +++ b/packages/website/docs/Api/Math.md @@ -4,87 +4,86 @@ title: Math --- ### E - -Euler's number; ≈ 2.718281828459045 - -```javascript -number; ``` +Math.E: +``` +Euler's number; ≈ 2.718281828459045Euler's number; ≈ 2.718281828459045 + + ### LN2 - -Natural logarithm of 2; ≈ 0.6931471805599453 - -```javascript -number; ``` +Math.LN2: +``` +Natural logarithm of 2; ≈ 0.6931471805599453Natural logarithm of 2; ≈ 0.6931471805599453 + + ### LN10 - -Natural logarithm of 10; ≈ 2.302585092994046 - -```javascript -number; ``` +Math.LN10: +``` +Natural logarithm of 10; ≈ 2.302585092994046Natural logarithm of 10; ≈ 2.302585092994046 + + ### LOG2E - -Base 2 logarithm of E; ≈ 1.4426950408889634 - -```javascript -number; ``` +Math.LOG2E: +``` +Base 2 logarithm of E; ≈ 1.4426950408889634Base 2 logarithm of E; ≈ 1.4426950408889634 + + ### LOG10E - -Base 10 logarithm of E; ≈ 0.4342944819032518 - -```javascript -number; ``` +Math.LOG10E: +``` +Base 10 logarithm of E; ≈ 0.4342944819032518Base 10 logarithm of E; ≈ 0.4342944819032518 + + ### PI - -Pi - ratio of the circumference to the diameter of a circle; ≈ 3.141592653589793 - -```javascript -number; ``` +Math.PI: +``` +Pi - ratio of the circumference to the diameter of a circle; ≈ 3.141592653589793Pi - ratio of the circumference to the diameter of a circle; ≈ 3.141592653589793 + + ### SQRT1_2 - -Square root of 1/2; ≈ 0.7071067811865476 - -```javascript -number; ``` +Math.SQRT1_2: +``` +Square root of 1/2; ≈ 0.7071067811865476Square root of 1/2; ≈ 0.7071067811865476 + + ### SQRT2 - -Square root of 2; ≈ 1.4142135623730951 - -```javascript -number; ``` +Math.SQRT2: +``` +Square root of 2; ≈ 1.4142135623730951Square root of 2; ≈ 1.4142135623730951 + + ### PHI - -Phi is the golden ratio. 1.618033988749895 - -```javascript -number; ``` +Math.PHI: +``` +Phi is the golden ratio. 1.618033988749895Phi is the golden ratio. 1.618033988749895 + + ### TAU - -Tau is the ratio constant of a circle's circumference to radius, equal to 2 \* pi. 6.283185307179586 - -```javascript -number; ``` +Math.TAU: +``` +Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi. 6.283185307179586Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi. 6.283185307179586 + + ### Infinity - -```javascript -number; ``` +Math.Infinity: +``` \ No newline at end of file From 6dc8b711bb48cf90591b6bd9dc36efd0f1d5bf49 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Fri, 10 Jun 2022 17:35:48 -0700 Subject: [PATCH 09/20] Lots of simple cleanup to api docs --- .../Reducer_Dispatch_BuiltIn_test.res | 2 +- .../ReducerInterface_Duration.res | 2 + .../ReducerInterface_GenericDistribution.res | 2 +- packages/website/docs/Api/Date.md | 42 ++++ packages/website/docs/Api/Dictionary.md | 52 ++-- packages/website/docs/Api/DistGeneric.mdx | 223 +++++++----------- packages/website/docs/Api/DistPointSet.md | 13 +- packages/website/docs/Api/DistSampleSet.md | 37 +-- packages/website/docs/Api/Duration.md | 40 +--- packages/website/docs/Api/List.md | 200 ++++------------ packages/website/docs/Api/Math.md | 45 +--- packages/website/docs/Api/Number.md | 100 +++----- 12 files changed, 273 insertions(+), 485 deletions(-) create mode 100644 packages/website/docs/Api/Date.md diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res index 682e1737..fb891bb3 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltIn_test.res @@ -18,7 +18,7 @@ describe("builtin", () => { testEval("2>1", "Ok(true)") testEval("concat('a','b')", "Ok('ab')") testEval( - "addOne(t)=t+1; toInternalSampleArray(mapSamples(fromSamples([1,2,3,4,5,6]), addOne))", + "addOne(t)=t+1; toList(mapSamples(fromSamples([1,2,3,4,5,6]), addOne))", "Ok([2,3,4,5,6,7])", ) }) diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_Duration.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_Duration.res index 4e10dfa0..f6322fc4 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_Duration.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_Duration.res @@ -27,6 +27,8 @@ let dispatch = (call: EV.functionCall, _: DistributionOperation.env): option< EV.EvTimeDuration(DateTime.Duration.multiply(d1, d2))->Ok->Some | ("divide", [EvTimeDuration(d1), EvNumber(d2)]) => EV.EvTimeDuration(DateTime.Duration.divide(d1, d2))->Ok->Some + | ("divide", [EvTimeDuration(d1), EvTimeDuration(d2)]) => + EV.EvNumber(d1 /. d2)->Ok->Some | _ => None } } diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res index 872e8145..2b49439a 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res @@ -277,7 +277,7 @@ let dispatchToGenericOutput = ( Helpers.toDistFn(ToSampleSet(Belt.Int.fromFloat(float)), dist, ~env) | ("toSampleSet", [EvDistribution(dist)]) => Helpers.toDistFn(ToSampleSet(env.sampleCount), dist, ~env) - | ("toInternalSampleArray", [EvDistribution(SampleSet(dist))]) => + | ("toList", [EvDistribution(SampleSet(dist))]) => Some(FloatArray(SampleSetDist.T.get(dist))) | ("fromSamples", [EvArray(inputArray)]) => { let _wrapInputErrors = x => SampleSetDist.NonNumericInput(x) diff --git a/packages/website/docs/Api/Date.md b/packages/website/docs/Api/Date.md new file mode 100644 index 00000000..cd6c766d --- /dev/null +++ b/packages/website/docs/Api/Date.md @@ -0,0 +1,42 @@ +--- +sidebar_position: 1 +title: Date +--- + +### makeFromYear + +``` +Date.makeFromYear: (number) => date +``` + +```js +makeFromYear(2022.32); +``` + +### toString + +``` +toString: (date) => string +``` + +### subtract + +``` +subtract: (date, date) => duration +subtract: (date, duration) => date +``` + +```js +makeFromYear(2040) - makeFromYear(2020) // 20 years +makeFromYear(2040) - years(20) // 2020 +``` + +### add + +``` +add: (date, duration) => date +``` + +```js +makeFromYear(2022.32) + years(5); +``` diff --git a/packages/website/docs/Api/Dictionary.md b/packages/website/docs/Api/Dictionary.md index 162fbdd8..6d0a2cbf 100644 --- a/packages/website/docs/Api/Dictionary.md +++ b/packages/website/docs/Api/Dictionary.md @@ -1,58 +1,58 @@ --- -sidebar_position: 1 +sidebar_position: 2 title: Dictionary --- - -### toString +### toList ``` -toString: (dict<'a>) => string +Dict.toList: (dict<'a>) => list> ``` - - -### get -``` -Dict.get: (dict<'a>, string) => a +```js +Dict.toList({foo: 3, bar: 20}) // [["foo", 3], ["bar", 20]] ``` - - -### set +### fromList ``` -Dict.set: (dict<'a>, string, a) => a +Dict.fromList: (list>) => dict<'a> ``` - - - -### toPairs +```js +Dict.fromList([["foo", 3], ["bar", 20]]) // {foo: 3, bar: 20} ``` -Dict.toPairs: (dict<'a>) => list> -``` - - ### keys ``` Dict.keys: (dict<'a>) => list ``` - - +```js +Dict.keys({foo: 3, bar: 20}) // ["foo", "bar"] +``` ### values ``` Dict.values: (dict<'a>) => list<'a> ``` - - +```js +Dict.values({foo: 3, bar: 20}) // [3,20] +``` ### merge ``` Dict.merge: (dict<'a>, dict<'b>) => dict<'a|b> ``` - +```js +first = {a: 1, b: 2} +snd = {b: 3, c: 5} +Dict.merge(first, snd) // {a: 1, b: 3, c: 5} +``` ### mergeMany ``` Dict.mergeMany: (list>) => dict<'a> +``` + +```js +first = {a: 1, b: 2} +snd = {b: 3, c: 5} +Dict.mergeMany([first, snd]) // {a: 1, b: 3, c: 5} ``` \ No newline at end of file diff --git a/packages/website/docs/Api/DistGeneric.mdx b/packages/website/docs/Api/DistGeneric.mdx index ddbd8de3..5b3869f2 100644 --- a/packages/website/docs/Api/DistGeneric.mdx +++ b/packages/website/docs/Api/DistGeneric.mdx @@ -1,32 +1,33 @@ --- -sidebar_position: 2 +sidebar_position: 3 title: Distribution --- -import TOCInline from '@theme/TOCInline'; + +import TOCInline from "@theme/TOCInline"; -## Creation +## Distribution Creation ### Normal Distribution **Definitions** ```javascript -normal(frValueDistOrNumber, frValueDistOrNumber); +normal: (frValueDistOrNumber, frValueDistOrNumber); ``` ```javascript -normal(dict<{p5: frValueDistOrNumber, p95: frValueDistOrNumber}>) +normal: (dict<{p5: frValueDistOrNumber, p95: frValueDistOrNumber}>) ``` ```javascript -normal(dict<{mean: frValueDistOrNumber, stdev: frValueDistOrNumber}>) +normal: (dict<{mean: frValueDistOrNumber, stdev: frValueDistOrNumber}>) ``` **Examples** -```javascript +```js normal(5, 1); normal({ p5: 4, p95: 10 }); normal({ mean: 5, stdev: 2 }); @@ -37,15 +38,15 @@ normal({ mean: 5, stdev: 2 }); **Definitions** ```javascript -lognormal(frValueDistOrNumber, frValueDistOrNumber); +lognormal: (frValueDistOrNumber, frValueDistOrNumber); ``` ```javascript -lognormal(dict<{p5: frValueDistOrNumber, p95: frValueDistOrNumber}>) +lognormal: (dict<{p5: frValueDistOrNumber, p95: frValueDistOrNumber}>) ``` ```javascript -lognormal(dict<{mean: frValueDistOrNumber, stdev: frValueDistOrNumber}>) +lognormal: (dict<{mean: frValueDistOrNumber, stdev: frValueDistOrNumber}>) ``` **Examples** @@ -61,7 +62,7 @@ lognormal({ mean: 5, stdev: 2 }); **Definitions** ```javascript -uniform(frValueDistOrNumber, frValueDistOrNumber); +uniform: (frValueDistOrNumber, frValueDistOrNumber); ``` **Examples** @@ -75,7 +76,7 @@ uniform(10, 12); **Definitions** ```javascript -beta(frValueDistOrNumber, frValueDistOrNumber); +beta: (frValueDistOrNumber, frValueDistOrNumber); ``` **Examples** @@ -89,7 +90,7 @@ beta(20, 25); **Definitions** ```javascript -cauchy(frValueDistOrNumber, frValueDistOrNumber); +cauchy: (frValueDistOrNumber, frValueDistOrNumber); ``` **Examples** @@ -103,7 +104,7 @@ cauchy(5, 1); **Definitions** ```javascript -gamma(frValueDistOrNumber, frValueDistOrNumber); +gamma: (frValueDistOrNumber, frValueDistOrNumber); ``` **Examples** @@ -117,7 +118,7 @@ gamma(5, 1); **Definitions** ```javascript -logistic(frValueDistOrNumber, frValueDistOrNumber); +logistic: (frValueDistOrNumber, frValueDistOrNumber); ``` **Examples** @@ -131,7 +132,7 @@ gamma(5, 1); **Definitions** ```javascript -to(frValueDistOrNumber, frValueDistOrNumber); +to: (frValueDistOrNumber, frValueDistOrNumber); ``` ```javascript @@ -151,7 +152,7 @@ to(5,10) **Definitions** ```javascript -exponential(frValueDistOrNumber); +exponential: (frValueDistOrNumber); ``` **Examples** @@ -165,7 +166,7 @@ exponential(2); **Definitions** ```javascript -bernoulli(frValueDistOrNumber); +bernoulli: (frValueDistOrNumber); ``` **Examples** @@ -181,7 +182,7 @@ Converts a set of points to a continuous distribution **Definitions** ```javascript -toContinuousPointSet(array>) +toContinuousPointSet: (array>) ``` **Examples** @@ -202,7 +203,7 @@ Converts a set of points to a discrete distribution **Definitions** ```javascript -toDiscretePointSet(array>) +toDiscretePointSet: (array>) ``` **Examples** @@ -216,41 +217,19 @@ toDiscretePointSet([ ]); ``` -### Declaration (Continuous Function) - -Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within. - -**Definitions** - -```javascript -declareFn(dict<{fn: lambda, inputs: array>}>) -``` - -**Examples** - -```javascript -declareFn({ - fn: {|a,b| a }, - inputs: [ - {min: 0, max: 100}, - {min: 30, max: 50} - ] -}) -``` - ## Functions - ### mixture ```javascript -(...distributionLike, weights:list):distribution +mixture: (...distributionLike, weights:list):distribution ``` **Examples** ```javascript mixture(normal(5, 1), normal(10, 1)); +mx(normal(5, 1), normal(10, 1), [0.3, 0.7]); ``` ### sample @@ -258,7 +237,7 @@ mixture(normal(5, 1), normal(10, 1)); Get one random sample from the distribution ```javascript -(distribution):number +sample(distribution):number ``` **Examples** @@ -272,13 +251,13 @@ sample(normal(5, 2)); Get n random samples from the distribution ```javascript -(distribution, number):list +sampleN: (distribution, number):list ``` **Examples** ```javascript -sample(normal(5, 2), 100); +sample: (normal(5, 2), 100); ``` ### mean @@ -286,73 +265,61 @@ sample(normal(5, 2), 100); Get the distribution mean ```javascript -(distribution):number +mean: (distribution):number ``` **Examples** ```javascript -mean(normal(5, 2)); +mean: (normal(5, 2)); ``` ### stdev ```javascript -(distribution):number +stdev: (distribution):number ``` ### variance ```javascript -(distribution):number +variance: (distribution):number ``` ### mode ```javascript -(distribution):number +mode: (distribution):number ``` ### cdf ```javascript -(distribution, number):number +cdf: (distribution, number):number ``` **Examples** ```javascript -cdf(normal(5, 2), 3); +cdf: (normal(5, 2), 3); ``` ### pdf ```javascript -(distribution, number):number +pdf: (distribution, number):number ``` **Examples** ```javascript -pdf(normal(5, 2), 3); -``` - -### pmf - -```javascript -(distribution, number):number -``` - -**Examples** - -```javascript -pmf(bernoulli(0.3), 0); // 0.7 +pdf: (normal(5, 2), 3); ``` ### inv ```javascript -(distribution, number):number +inv: (distribution, number):number ``` **Examples** @@ -366,7 +333,7 @@ inv(normal(5, 2), 0.5); Converts a distribution to the pointSet format ```javascript -(distribution):pointSetDistribution +toPointSet: (distribution):pointSetDistribution ``` **Examples** @@ -380,13 +347,13 @@ toPointSet(normal(5, 2)); Converts a distribution to the sampleSet format, with n samples ```javascript -(distribution,n):sampleSetribution +toSampleSet: (distribution,number):sampleSetDistribution ``` **Examples** ```javascript -toSampleSet(normal(5, 2)); +toSampleSet(normal(5, 2), 1000); ``` ### truncateLeft @@ -394,7 +361,7 @@ toSampleSet(normal(5, 2)); Truncates the left side of a distribution. Returns either a pointSet distribution or a symbolic distribution. ```javascript -(distribution, l:number, {normalize: boolean=true}):distribution +truncateLeft: (distribution, l:number):distribution ``` **Examples** @@ -408,7 +375,7 @@ truncateLeft(normal(5, 2), 3); Truncates the right side of a distribution. Returns either a pointSet distribution or a symbolic distribution. ```javascript -(distribution, r:number, {normalize: boolean=true}):distribution +truncateRight: (distribution, r:number):distribution ``` **Examples** @@ -424,7 +391,7 @@ truncateLeft(normal(5, 2), 6); Kullback–Leibler divergence between two distributions ```javascript -(distribution, distribution):number +klDivergence: (distribution, distribution):number ``` **Examples** @@ -433,24 +400,12 @@ Kullback–Leibler divergence between two distributions klDivergence(normal(5, 2), normal(5, 4)); // returns 0.57 ``` -### logScore - -```javascript -({estimate: distribution, prior?: distribution, answer: distribution|number}):number -``` - -**Examples** - -```javascript -logScore({ estimate: normal(5, 2), prior: normal(5.5, 4), answer: 2.3 }); -``` - ## Display ### toString ```javascript -(distribution):string +: (distribution):string ``` **Examples** @@ -464,7 +419,7 @@ toString(normal(5, 2)); Produce a sparkline of length n ```javascript -(distribution, n=20):string +toSparkline: (distribution, n=20):string ``` **Examples** @@ -478,7 +433,7 @@ toSparkline(normal(5, 2), 10); Prints the value of the distribution to the Javascript console, then returns the distribution. ```javascript -(distribution):distribution +inspect: (distribution):distribution ``` **Examples** @@ -494,7 +449,7 @@ inspect(normal(5, 2)); Normalize a distribution. This means scaling it appropriately so that it's cumulative sum is equal to 1. ```javascript -(distribution):distribution +normalize: (distribution):distribution ``` **Examples** @@ -508,7 +463,7 @@ normalize(normal(5, 2)); Check of a distribution is normalized. Most distributions are typically normalized, but there are some commands that could produce non-normalized distributions. ```javascript -(distribution):bool +isNormalized: (distribution):bool ``` **Examples** @@ -522,7 +477,7 @@ isNormalized(normal(5, 2)); // returns true Get the sum of the integral of a distribution. If the distribution is normalized, this will be 1. ```javascript -(distribution):number +integralSum: (distribution):number ``` **Examples** @@ -531,158 +486,162 @@ Get the sum of the integral of a distribution. If the distribution is normalized integralSum(normal(5, 2)); ``` -## Algebra1 +## Algebraic Operations ### add ```javascript -(distributionLike, distributionLike): distribution +add: (distributionLike, distributionLike): distribution ``` ### sum ```javascript -(list): distribution +sum: (list): distribution ``` ### multiply ```javascript -(distributionLike, distributionLike): distribution +multiply: (distributionLike, distributionLike): distribution ``` ### product ```javascript -(list): distribution +product: (list): distribution ``` ### subtract ```javascript -(distributionLike, distributionLike): distribution +subtract: (distributionLike, distributionLike): distribution ``` ### divide ```javascript -(distributionLike, distributionLike): distribution +divide: (distributionLike, distributionLike): distribution ``` ### pow ```javascript -(distributionLike, distributionLike): distribution +pow: (distributionLike, distributionLike): distribution ``` ### exp ```javascript -(distributionLike, distributionLike): distribution +exp: (distributionLike, distributionLike): distribution ``` ### log ```javascript -(distributionLike, distributionLike): distribution +log: (distributionLike, distributionLike): distribution ``` ### log10 ```javascript -(distributionLike, distributionLike):distribution +log10: (distributionLike, distributionLike):distribution ``` ### unaryMinus ```javascript -(distribution):distribution +unaryMinus: (distribution):distribution ``` -## Algebra2 +## Pointwise Operations ### dotAdd ```javascript -(distributionLike, distributionLike): distribution -``` - -### dotSum - -```javascript -(list): distribution +dotAdd: (distributionLike, distributionLike): distribution ``` ### dotMultiply ```javascript -(distributionLike, distributionLike): distribution -``` - -### dotProduct - -```javascript -(list): distribution +dotMultiply: (distributionLike, distributionLike): distribution ``` ### dotSubtract ```javascript -(distributionLike, distributionLike): distribution +dotSubtract: (distributionLike, distributionLike): distribution ``` ### dotDivide ```javascript -(distributionLike, distributionLike): distribution +dotDivide: (distributionLike, distributionLike): distribution ``` ### dotPow ```javascript -(distributionLike, distributionLike): distribution +dotPow: (distributionLike, distributionLike): distribution ``` ### dotExp ```javascript -(distributionLike, distributionLike): distribution +dotExp: (distributionLike, distributionLike): distribution ``` -## Algebra3 +## Scale Operations ### scaleMultiply ```javascript -(distributionLike, distributionLike): distribution +scaleMultiply: (distributionLike, number): distribution ``` ### scalePow ```javascript -(distributionLike, distributionLike): distribution +scalePow: (distributionLike, number): distribution ``` ### scaleExp ```javascript -(distributionLike, distributionLike): distribution +scaleExp: (distributionLike, number): distribution ``` ### scaleLog ```javascript -(distributionLike, distributionLike): distribution +scaleLog: (distributionLike, number): distribution ``` ### scaleLog10 ```javascript -(distributionLike, distributionLike): distribution +scaleLog10: (distributionLike, number): distribution ``` -### scaleLogWithThreshold +## Special + +### Declaration (Continuous Function) + +Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within. ```javascript -(distributionLike, distributionLike, number): distribution +declareFn: (dict<{fn: lambda, inputs: array>}>) +``` + +**Examples** + +```javascript +declareFn({ + fn: {|a,b| a }, + inputs: [ + {min: 0, max: 100}, + {min: 30, max: 50} + ] +}) ``` diff --git a/packages/website/docs/Api/DistPointSet.md b/packages/website/docs/Api/DistPointSet.md index 0b638d88..f5336d24 100644 --- a/packages/website/docs/Api/DistPointSet.md +++ b/packages/website/docs/Api/DistPointSet.md @@ -1,5 +1,5 @@ --- -sidebar_position: 3 +sidebar_position: 4 title: Point Set Distribution --- @@ -8,23 +8,12 @@ title: Point Set Distribution PointSet.make: (distribution) => pointSetDist ``` - - ### makeContinuous ``` PointSet.makeContinuous: (list<{x: number, y: number}>) => pointSetDist ``` - - ### makeDiscrete ``` PointSet.makeDiscrete: (list<{x: number, y: number}>) => pointSetDist -``` - - - -### mapPoints -``` -PointSet.mapPoints: (pointSetDist, ({x:number, y:number} => {x:number, y:number})) => pointSetDist ``` \ No newline at end of file diff --git a/packages/website/docs/Api/DistSampleSet.md b/packages/website/docs/Api/DistSampleSet.md index b9a722d4..bf489ecf 100644 --- a/packages/website/docs/Api/DistSampleSet.md +++ b/packages/website/docs/Api/DistSampleSet.md @@ -1,5 +1,5 @@ --- -sidebar_position: 4 +sidebar_position: 5 title: Sample Set Distribution --- @@ -10,58 +10,31 @@ SampleSet.make: (() => number) => sampleSet SampleSet.make: (list) => sampleSet ``` - - -### kde -``` -SampleSet.kde: (sampleSet) => pointSetDist -``` - - - -### toEmpiricalPdf -``` -SampleSet.toEmpiricalPdf: (sampleSet) => pointSetDist -``` - - - ### map ``` SampleSet.map: (sampleSet, (number => number)) => sampleSet ``` - ### map2 ``` SampleSet.map2: (sampleSet, sampleSet, ((number, number) => number)) => sampleSet ``` - - ### map3 ``` SampleSet.map3: (sampleSet, sampleSet, sampleSet, ((number, number, number) => number)) => sampleSet ``` - -### correlation +### toList ``` -SampleSet.correlation: (sampleSet, sampleSet) => number +SampleSet.toList: (sampleSet) => list ``` - - - -### toInternalSampleArray -``` -SampleSet.toInternalSampleArray: (sampleSet) => list -``` -Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toInternalSampleArray() maintains order and length.Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toInternalSampleArray() maintains order and length. +Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toList() maintains order and length. Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toList() maintains order and length. **Examples** ``` -toInternalSampleArray(toSampleSet(normal(5,2))) +toList(toSampleSet(normal(5,2))) ``` \ No newline at end of file diff --git a/packages/website/docs/Api/Duration.md b/packages/website/docs/Api/Duration.md index a2af98d0..57df9d65 100644 --- a/packages/website/docs/Api/Duration.md +++ b/packages/website/docs/Api/Duration.md @@ -1,5 +1,5 @@ --- -sidebar_position: 5 +sidebar_position: 6 title: Duration --- @@ -8,86 +8,62 @@ title: Duration toString: (duration) => string ``` - - ### minutes ``` minutes: (number) => duration ``` - - ### hours ``` hours: (number) => duration ``` - - ### days ``` days: (number) => duration ``` - - ### years ``` years: (number) => duration ``` - - ### toHours ``` -Duration.toHours: (duration) => number +toHours: (duration) => number ``` - - ### toMinutes ``` -Duration.toMinutes: (duration) => number +toMinutes: (duration) => number ``` - - ### toDays ``` -Duration.toDays: (duration) => number +toDays: (duration) => number ``` - - ### toYears ``` -Duration.toYears: (duration) => number +toYears: (duration) => number ``` - - ### add ``` add: (duration, duration) => duration ``` - - ### subtract ``` subtract: (duration, duration) => duration ``` - - ### multiply ``` -multiply: (duration, duration) => duration +multiply: (duration, number) => duration ``` - - ### divide ``` -divide: (duration, duration) => duration -``` +divide: (duration, number) => duration +``` \ No newline at end of file diff --git a/packages/website/docs/Api/List.md b/packages/website/docs/Api/List.md index ef2e537e..06623b20 100644 --- a/packages/website/docs/Api/List.md +++ b/packages/website/docs/Api/List.md @@ -1,179 +1,81 @@ --- -sidebar_position: 6 +sidebar_position: 7 title: List --- -## make +### make ``` List.make: (number, 'a) => list<'a> -List.make: (number, number => a) => list<'a> -List.make: (pointSetDist) => list +``` +Returns an array of size ``n`` filled with value ``e``. + +```js +List.make(4, 1) // creates the list [1,1,1,1] ``` - +See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/belt/array#make) ### toString ``` -List.toString: (list<'a>) => string +toString: (list<'a>) => string ``` - - ### length ``` -List.length: (list<'a>) => number +length: (list<'a>) => number ``` - - -### get +### up to ``` -List.get: (list<'a>, number) => 'a +List.upTo: (low:number, high:number) => list +``` +```js +List.upTo(0, 5) // creates the list [0,1,2,3,4,5] ``` - - -### find -``` -List.find: (list<'a>, 'a => bool) => 'a -``` - - - -### filter -``` -List.filter: (list<'a>, 'a => bool) => 'a -``` - - - -### set -``` -List.set: (list<'a>, number, 'a) => 'a -``` - - - -### shuffle -``` -List.shuffle: (list<'a>) => list<'a> -``` - - - -### reverse -``` -List.reverse: (list<'a>) => list<'a> -``` - - - -### range -``` -List.range: (low:number, high:number, increment?:number=1.0) => list -``` - - - -### zip -``` -List.zip: (list<'a>, list<'b>) => list> -``` - - - -### unzip -``` -List.unzip: (list>) => list, list<'b>> -``` - - - -### concat -``` -List.concat: (list<'a>, list<'b>) => list<'a|b> -``` - - - -### concatMany -``` -List.concatMany: (list>) => list<'a> -``` - - - -### slice -``` -List.slice: -``` - - - -### map -``` -List.map: (list<'a>, a => b) => list<'b> -``` - - - -### reduce -``` -List.reduce: -``` - - - -### reduceRight -``` -List.reduceRight: -``` - - - -### includes -``` -List.includes: (list<'a>, 'a => bool) => boolean -``` - - - -### every -``` -List.every: (list<'a>, 'a => bool) => boolean -``` - - - -### truncate -``` -List.truncate: (list<'a>, number) => list<'a> -``` - - - -### uniq -``` -List.uniq: (list<'a>) => list<'a> -``` - - +Syntax taken from [Ruby](https://apidock.com/ruby/v2_5_5/Integer/upto). ### first ``` -List.first: (list<'a>) => 'a +first: (list<'a>) => 'a ``` - - ### last ``` -List.last: (list<'a>) => 'a +last: (list<'a>) => 'a ``` - - -### sort +### reverse ``` -List.sort: (list<'a>) => list<'a> -``` \ No newline at end of file +reverse: (list<'a>) => list<'a> +``` + +### map +``` +map: (list<'a>, a => b) => list<'b> +``` + +See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/belt/array#map). + +### reduce +``` +reduce: (list<'b>, 'a, ('a, 'b) => 'a) => 'a +``` +``reduce(arr, init, f)`` + +Applies ``f`` to each element of ``arr``. The function ``f`` has two paramaters, an accumulator and the next value from the array. + +```js +reduce([2, 3, 4], 1, {|acc, value| acc + value}) == 10 +``` + +See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/belt/array#reduce). + +### reduce reverse +``` +reduceReverse: (list<'b>, 'a, ('a, 'b) => 'a) => 'a +``` + +Works like ``reduce``, but the function is applied to each item from the last back to the first. + +See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/belt/array#reducereverse). \ No newline at end of file diff --git a/packages/website/docs/Api/Math.md b/packages/website/docs/Api/Math.md index fa8a65df..e64d6352 100644 --- a/packages/website/docs/Api/Math.md +++ b/packages/website/docs/Api/Math.md @@ -1,5 +1,5 @@ --- -sidebar_position: 7 +sidebar_position: 8 title: Math --- @@ -7,25 +7,19 @@ title: Math ``` Math.E: ``` -Euler's number; ≈ 2.718281828459045Euler's number; ≈ 2.718281828459045 - - +Euler's number; ≈ 2.718281828459045 ### LN2 ``` Math.LN2: ``` -Natural logarithm of 2; ≈ 0.6931471805599453Natural logarithm of 2; ≈ 0.6931471805599453 - - +Natural logarithm of 2; ≈ 0.6931471805599453 ### LN10 ``` Math.LN10: ``` -Natural logarithm of 10; ≈ 2.302585092994046Natural logarithm of 10; ≈ 2.302585092994046 - - +Natural logarithm of 10; ≈ 2.302585092994046 ### LOG2E ``` @@ -33,57 +27,38 @@ Math.LOG2E: ``` Base 2 logarithm of E; ≈ 1.4426950408889634Base 2 logarithm of E; ≈ 1.4426950408889634 - - ### LOG10E ``` Math.LOG10E: ``` -Base 10 logarithm of E; ≈ 0.4342944819032518Base 10 logarithm of E; ≈ 0.4342944819032518 - - +Base 10 logarithm of E; ≈ 0.4342944819032518 ### PI ``` Math.PI: ``` -Pi - ratio of the circumference to the diameter of a circle; ≈ 3.141592653589793Pi - ratio of the circumference to the diameter of a circle; ≈ 3.141592653589793 - - +Pi - ratio of the circumference to the diameter of a circle; ≈ 3.141592653589793 ### SQRT1_2 ``` Math.SQRT1_2: ``` -Square root of 1/2; ≈ 0.7071067811865476Square root of 1/2; ≈ 0.7071067811865476 - - +Square root of 1/2; ≈ 0.7071067811865476 ### SQRT2 ``` Math.SQRT2: ``` -Square root of 2; ≈ 1.4142135623730951Square root of 2; ≈ 1.4142135623730951 - - +Square root of 2; ≈ 1.4142135623730951 ### PHI ``` Math.PHI: ``` -Phi is the golden ratio. 1.618033988749895Phi is the golden ratio. 1.618033988749895 - - +Phi is the golden ratio. 1.618033988749895 ### TAU ``` Math.TAU: ``` -Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi. 6.283185307179586Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi. 6.283185307179586 - - - -### Infinity -``` -Math.Infinity: -``` \ No newline at end of file +Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi. 6.283185307179586 diff --git a/packages/website/docs/Api/Number.md b/packages/website/docs/Api/Number.md index ace6fd2f..dcd10752 100644 --- a/packages/website/docs/Api/Number.md +++ b/packages/website/docs/Api/Number.md @@ -1,166 +1,136 @@ --- -sidebar_position: 8 +sidebar_position: 9 title: Number --- ### ceil ```javascript -(number): number +ceil: (number) => number ``` ### floor ```javascript -(number): number +floor: (number) => number ``` ### abs ```javascript -(number): number +abs: (number) => number ``` ### round ```javascript -(number): number +round: (number) => number ``` ### max ```javascript -(list): number -``` - -### maxBy - -```javascript -(list, fn(element)):number +max: (list) => number ``` ### min ```javascript -(list): number -``` - -### minBy - -```javascript -(list, fn(element)):number -``` - -### random - -```javascript -number; -``` - -### randomInt - -```javascript -number; +min: (list) => number ``` ### mean ```javascript -(list): number +mean: (list) => number ``` -### median +### stdev ```javascript -(list): number -``` - -### mode - -```javascript -(list): number -``` - -### std - -```javascript -(list): number +stdev: (list) => number ``` ### variance ```javascript -(list): number +variance: (list) => number ``` ### unaryMinus ```javascript -(number): number +unaryMinus: (number) => number ``` ### equal ```javascript -(number, number): boolean +equal: (number, number) => boolean ``` ### add ```javascript -(number, number): number +add: (number, number) => number ``` ### sum ```javascript -(number, number): number +sum: (list) => number +``` + +### cumulative sum + +``` +cumsum: (list) => list ``` ### multiply ```javascript -(number, number): number +multiply: (number, number) => number ``` ### product ```javascript -(number, number): number +product: (list) => number +``` + +### cumulative product + +``` +cumprod: (list) => list ``` ### subtract ```javascript -(number, number): number +subtract: (number, number) => number ``` ### divide ```javascript -(number, number): number +divide: (number, number) => number ``` ### pow ```javascript -(number, number): number +pow: (number, number) => number ``` ### exp ```javascript -(number): number +exp: (number) => number ``` ### log ```javascript -(number, number=Math.e): number -``` - -### log10 - -```javascript -(number): number -``` +log: (number) => number +``` \ No newline at end of file From 2d4d8a8f4de8d5b507d45ebffdc20bb4c05e0b49 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 11 Jun 2022 08:28:38 -0700 Subject: [PATCH 10/20] Attempting to make all api docs formatting mostly consistent --- packages/website/docs/Api/Dictionary.md | 2 +- packages/website/docs/Api/DistGeneric.mdx | 78 +++++++++---------- .../docs/Api/{Duration.md => Duration.mdx} | 8 ++ packages/website/docs/Api/List.md | 4 +- .../docs/Api/{Number.md => Number.mdx} | 8 ++ 5 files changed, 58 insertions(+), 42 deletions(-) rename packages/website/docs/Api/{Duration.md => Duration.mdx} (88%) rename packages/website/docs/Api/{Number.md => Number.mdx} (93%) diff --git a/packages/website/docs/Api/Dictionary.md b/packages/website/docs/Api/Dictionary.md index 6d0a2cbf..a31ba8ad 100644 --- a/packages/website/docs/Api/Dictionary.md +++ b/packages/website/docs/Api/Dictionary.md @@ -32,7 +32,7 @@ Dict.keys({foo: 3, bar: 20}) // ["foo", "bar"] Dict.values: (dict<'a>) => list<'a> ``` ```js -Dict.values({foo: 3, bar: 20}) // [3,20] +Dict.values({foo: 3, bar: 20}) // [3, 20] ``` ### merge diff --git a/packages/website/docs/Api/DistGeneric.mdx b/packages/website/docs/Api/DistGeneric.mdx index 5b3869f2..859f53db 100644 --- a/packages/website/docs/Api/DistGeneric.mdx +++ b/packages/website/docs/Api/DistGeneric.mdx @@ -222,7 +222,7 @@ toDiscretePointSet([ ### mixture ```javascript -mixture: (...distributionLike, weights:list):distribution +mixture: (...distributionLike, weights:list) => distribution ``` **Examples** @@ -237,7 +237,7 @@ mx(normal(5, 1), normal(10, 1), [0.3, 0.7]); Get one random sample from the distribution ```javascript -sample(distribution):number +sample(distribution) => number ``` **Examples** @@ -265,7 +265,7 @@ sample: (normal(5, 2), 100); Get the distribution mean ```javascript -mean: (distribution):number +mean: (distribution) => number ``` **Examples** @@ -277,25 +277,25 @@ mean: (normal(5, 2)); ### stdev ```javascript -stdev: (distribution):number +stdev: (distribution) => number ``` ### variance ```javascript -variance: (distribution):number +variance: (distribution) => number ``` ### mode ```javascript -mode: (distribution):number +mode: (distribution) => number ``` ### cdf ```javascript -cdf: (distribution, number):number +cdf: (distribution, number) => number ``` **Examples** @@ -307,7 +307,7 @@ cdf: (normal(5, 2), 3); ### pdf ```javascript -pdf: (distribution, number):number +pdf: (distribution, number) => number ``` **Examples** @@ -319,7 +319,7 @@ pdf: (normal(5, 2), 3); ### inv ```javascript -inv: (distribution, number):number +inv: (distribution, number) => number ``` **Examples** @@ -361,7 +361,7 @@ toSampleSet(normal(5, 2), 1000); Truncates the left side of a distribution. Returns either a pointSet distribution or a symbolic distribution. ```javascript -truncateLeft: (distribution, l:number):distribution +truncateLeft: (distribution, l => number) => distribution ``` **Examples** @@ -375,7 +375,7 @@ truncateLeft(normal(5, 2), 3); Truncates the right side of a distribution. Returns either a pointSet distribution or a symbolic distribution. ```javascript -truncateRight: (distribution, r:number):distribution +truncateRight: (distribution, r => number) => distribution ``` **Examples** @@ -391,7 +391,7 @@ truncateLeft(normal(5, 2), 6); Kullback–Leibler divergence between two distributions ```javascript -klDivergence: (distribution, distribution):number +klDivergence: (distribution, distribution) => number ``` **Examples** @@ -405,7 +405,7 @@ klDivergence(normal(5, 2), normal(5, 4)); // returns 0.57 ### toString ```javascript -: (distribution):string +: (distribution) => string ``` **Examples** @@ -419,7 +419,7 @@ toString(normal(5, 2)); Produce a sparkline of length n ```javascript -toSparkline: (distribution, n=20):string +toSparkline: (distribution, n=20) => string ``` **Examples** @@ -433,7 +433,7 @@ toSparkline(normal(5, 2), 10); Prints the value of the distribution to the Javascript console, then returns the distribution. ```javascript -inspect: (distribution):distribution +inspect: (distribution) => distribution ``` **Examples** @@ -449,7 +449,7 @@ inspect(normal(5, 2)); Normalize a distribution. This means scaling it appropriately so that it's cumulative sum is equal to 1. ```javascript -normalize: (distribution):distribution +normalize: (distribution) => distribution ``` **Examples** @@ -477,7 +477,7 @@ isNormalized(normal(5, 2)); // returns true Get the sum of the integral of a distribution. If the distribution is normalized, this will be 1. ```javascript -integralSum: (distribution):number +integralSum: (distribution) => number ``` **Examples** @@ -491,67 +491,67 @@ integralSum(normal(5, 2)); ### add ```javascript -add: (distributionLike, distributionLike): distribution +add: (distributionLike, distributionLike) => distribution ``` ### sum ```javascript -sum: (list): distribution +sum: (list) => distribution ``` ### multiply ```javascript -multiply: (distributionLike, distributionLike): distribution +multiply: (distributionLike, distributionLike) => distribution ``` ### product ```javascript -product: (list): distribution +product: (list) => distribution ``` ### subtract ```javascript -subtract: (distributionLike, distributionLike): distribution +subtract: (distributionLike, distributionLike) => distribution ``` ### divide ```javascript -divide: (distributionLike, distributionLike): distribution +divide: (distributionLike, distributionLike) => distribution ``` ### pow ```javascript -pow: (distributionLike, distributionLike): distribution +pow: (distributionLike, distributionLike) => distribution ``` ### exp ```javascript -exp: (distributionLike, distributionLike): distribution +exp: (distributionLike, distributionLike) => distribution ``` ### log ```javascript -log: (distributionLike, distributionLike): distribution +log: (distributionLike, distributionLike) => distribution ``` ### log10 ```javascript -log10: (distributionLike, distributionLike):distribution +log10: (distributionLike, distributionLike) => distribution ``` ### unaryMinus ```javascript -unaryMinus: (distribution):distribution +unaryMinus: (distribution) => distribution ``` ## Pointwise Operations @@ -559,37 +559,37 @@ unaryMinus: (distribution):distribution ### dotAdd ```javascript -dotAdd: (distributionLike, distributionLike): distribution +dotAdd: (distributionLike, distributionLike) => distribution ``` ### dotMultiply ```javascript -dotMultiply: (distributionLike, distributionLike): distribution +dotMultiply: (distributionLike, distributionLike) => distribution ``` ### dotSubtract ```javascript -dotSubtract: (distributionLike, distributionLike): distribution +dotSubtract: (distributionLike, distributionLike) => distribution ``` ### dotDivide ```javascript -dotDivide: (distributionLike, distributionLike): distribution +dotDivide: (distributionLike, distributionLike) => distribution ``` ### dotPow ```javascript -dotPow: (distributionLike, distributionLike): distribution +dotPow: (distributionLike, distributionLike) => distribution ``` ### dotExp ```javascript -dotExp: (distributionLike, distributionLike): distribution +dotExp: (distributionLike, distributionLike) => distribution ``` ## Scale Operations @@ -597,31 +597,31 @@ dotExp: (distributionLike, distributionLike): distribution ### scaleMultiply ```javascript -scaleMultiply: (distributionLike, number): distribution +scaleMultiply: (distributionLike, number) => distribution ``` ### scalePow ```javascript -scalePow: (distributionLike, number): distribution +scalePow: (distributionLike, number) => distribution ``` ### scaleExp ```javascript -scaleExp: (distributionLike, number): distribution +scaleExp: (distributionLike, number) => distribution ``` ### scaleLog ```javascript -scaleLog: (distributionLike, number): distribution +scaleLog: (distributionLike, number) => distribution ``` ### scaleLog10 ```javascript -scaleLog10: (distributionLike, number): distribution +scaleLog10: (distributionLike, number) => distribution ``` ## Special diff --git a/packages/website/docs/Api/Duration.md b/packages/website/docs/Api/Duration.mdx similarity index 88% rename from packages/website/docs/Api/Duration.md rename to packages/website/docs/Api/Duration.mdx index 57df9d65..52c50130 100644 --- a/packages/website/docs/Api/Duration.md +++ b/packages/website/docs/Api/Duration.mdx @@ -3,11 +3,17 @@ sidebar_position: 6 title: Duration --- +import TOCInline from "@theme/TOCInline"; + + + ### toString ``` toString: (duration) => string ``` +## Units + ### minutes ``` minutes: (number) => duration @@ -48,6 +54,8 @@ toDays: (duration) => number toYears: (duration) => number ``` +## Algebra + ### add ``` add: (duration, duration) => duration diff --git a/packages/website/docs/Api/List.md b/packages/website/docs/Api/List.md index 06623b20..9a1e880b 100644 --- a/packages/website/docs/Api/List.md +++ b/packages/website/docs/Api/List.md @@ -10,7 +10,7 @@ List.make: (number, 'a) => list<'a> Returns an array of size ``n`` filled with value ``e``. ```js -List.make(4, 1) // creates the list [1,1,1,1] +List.make(4, 1) // creates the list [1, 1, 1, 1] ``` See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/belt/array#make) @@ -30,7 +30,7 @@ length: (list<'a>) => number List.upTo: (low:number, high:number) => list ``` ```js -List.upTo(0, 5) // creates the list [0,1,2,3,4,5] +List.upTo(0, 5) // creates the list [0, 1, 2, 3, 4, 5] ``` Syntax taken from [Ruby](https://apidock.com/ruby/v2_5_5/Integer/upto). diff --git a/packages/website/docs/Api/Number.md b/packages/website/docs/Api/Number.mdx similarity index 93% rename from packages/website/docs/Api/Number.md rename to packages/website/docs/Api/Number.mdx index dcd10752..e544b4f6 100644 --- a/packages/website/docs/Api/Number.md +++ b/packages/website/docs/Api/Number.mdx @@ -3,6 +3,10 @@ sidebar_position: 9 title: Number --- +import TOCInline from "@theme/TOCInline"; + + + ### ceil ```javascript @@ -27,6 +31,8 @@ abs: (number) => number round: (number) => number ``` +## Statistics + ### max ```javascript @@ -57,6 +63,8 @@ stdev: (list) => number variance: (list) => number ``` +## Algebra + ### unaryMinus ```javascript From 79b71c39a090a3d1a1dd8d69ee773def09ae0e2a Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 11 Jun 2022 08:47:52 -0700 Subject: [PATCH 11/20] Ran formatter and fixed tests --- .../Reducer_Peggy_ToExpression_type_test.res | 4 +- .../Reducer/Reducer_mapReduce_test.res | 2 +- .../FunctionRegistry_Core.res | 6 +-- .../ReducerInterface_Duration.res | 3 +- .../ReducerInterface_GenericDistribution.res | 3 +- packages/website/docs/Api/DistGeneric.mdx | 48 +++++++++---------- 6 files changed, 32 insertions(+), 34 deletions(-) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_type_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_type_test.res index 05ec5722..e5609aea 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_type_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_Peggy/Reducer_Peggy_ToExpression_type_test.res @@ -88,8 +88,8 @@ describe("Peggy Types to Expression", () => { }) describe("squiggle expressions in type modifiers", () => { testToExpression( - "odds1 = [1,3,5]; odds2 = [7, 9]; type odds = number<-memberOf(odds1 + odds2)", - "{(:$_let_$ :odds1 {(:$_constructArray_$ (1 3 5))}); (:$_let_$ :odds2 {(:$_constructArray_$ (7 9))}); (:$_typeAlias_$ #odds (:$_typeModifier_memberOf_$ #number (:add :odds1 :odds2)))}", + "odds1 = [1,3,5]; odds2 = [7, 9]; type odds = number<-memberOf(concat(odds1, odds2))", + "{(:$_let_$ :odds1 {(:$_constructArray_$ (1 3 5))}); (:$_let_$ :odds2 {(:$_constructArray_$ (7 9))}); (:$_typeAlias_$ #odds (:$_typeModifier_memberOf_$ #number (:concat :odds1 :odds2)))}", ~v="{_typeAliases_: {odds: {typeTag: 'typeIdentifier',typeIdentifier: #number,memberOf: [1,3,5,7,9]}},odds1: [1,3,5],odds2: [7,9]}", (), ) diff --git a/packages/squiggle-lang/__tests__/Reducer/Reducer_mapReduce_test.res b/packages/squiggle-lang/__tests__/Reducer/Reducer_mapReduce_test.res index 5414f827..f3df0962 100644 --- a/packages/squiggle-lang/__tests__/Reducer/Reducer_mapReduce_test.res +++ b/packages/squiggle-lang/__tests__/Reducer/Reducer_mapReduce_test.res @@ -7,7 +7,7 @@ describe("map reduce", () => { testEvalToBe("change(acc,x)=acc*x+x; arr=[1,2,3]; reduce(arr, 0, change)", "Ok(15)") testEvalToBe("change(acc,x)=acc*x+x; arr=[1,2,3]; reduceReverse(arr, 0, change)", "Ok(9)") testEvalToBe("arr=[1,2,3]; reverse(arr)", "Ok([3,2,1])") - testEvalToBe("check(x)=(x==2);arr=[1,2,3]; keep(arr,check)", "Ok([2])") + testEvalToBe("check(x)=(x==2);arr=[1,2,3]; filter(arr,check)", "Ok([2])") }) Skip.describe("map reduce (sam)", () => { diff --git a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res index d1ef1359..22323e80 100644 --- a/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res +++ b/packages/squiggle-lang/src/rescript/FunctionRegistry/FunctionRegistry_Core.res @@ -350,7 +350,7 @@ module Function = { description: description, } - let toSimple = (t: t): functionJson => { + let toJson = (t: t): functionJson => { name: t.name, definitions: t.definitions->E.A2.fmap(FnDefinition.toString), examples: t.examples, @@ -360,7 +360,7 @@ module Function = { } module Registry = { - let toSimple = (r: registry) => r->E.A2.fmap(Function.toSimple) + let toJson = (r: registry) => r->E.A2.fmap(Function.toJson) /* There's a (potential+minor) bug here: If a function definition is called outside of the calls @@ -374,7 +374,7 @@ module Registry = { ~env: DistributionOperation.env, ) => { let matchToDef = m => Matcher.Registry.matchToDef(registry, m) - Js.log(toSimple(registry)) + //Js.log(toSimple(registry)) let showNameMatchDefinitions = matches => { let defs = matches diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_Duration.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_Duration.res index f6322fc4..b11eda89 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_Duration.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_Duration.res @@ -27,8 +27,7 @@ let dispatch = (call: EV.functionCall, _: DistributionOperation.env): option< EV.EvTimeDuration(DateTime.Duration.multiply(d1, d2))->Ok->Some | ("divide", [EvTimeDuration(d1), EvNumber(d2)]) => EV.EvTimeDuration(DateTime.Duration.divide(d1, d2))->Ok->Some - | ("divide", [EvTimeDuration(d1), EvTimeDuration(d2)]) => - EV.EvNumber(d1 /. d2)->Ok->Some + | ("divide", [EvTimeDuration(d1), EvTimeDuration(d2)]) => EV.EvNumber(d1 /. d2)->Ok->Some | _ => None } } diff --git a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res index 2b49439a..6ef3f7a6 100644 --- a/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res +++ b/packages/squiggle-lang/src/rescript/ReducerInterface/ReducerInterface_GenericDistribution.res @@ -277,8 +277,7 @@ let dispatchToGenericOutput = ( Helpers.toDistFn(ToSampleSet(Belt.Int.fromFloat(float)), dist, ~env) | ("toSampleSet", [EvDistribution(dist)]) => Helpers.toDistFn(ToSampleSet(env.sampleCount), dist, ~env) - | ("toList", [EvDistribution(SampleSet(dist))]) => - Some(FloatArray(SampleSetDist.T.get(dist))) + | ("toList", [EvDistribution(SampleSet(dist))]) => Some(FloatArray(SampleSetDist.T.get(dist))) | ("fromSamples", [EvArray(inputArray)]) => { let _wrapInputErrors = x => SampleSetDist.NonNumericInput(x) let parsedArray = Helpers.parseNumberArray(inputArray)->E.R2.errMap(_wrapInputErrors) diff --git a/packages/website/docs/Api/DistGeneric.mdx b/packages/website/docs/Api/DistGeneric.mdx index 859f53db..17dfdc4e 100644 --- a/packages/website/docs/Api/DistGeneric.mdx +++ b/packages/website/docs/Api/DistGeneric.mdx @@ -14,15 +14,15 @@ import TOCInline from "@theme/TOCInline"; **Definitions** ```javascript -normal: (frValueDistOrNumber, frValueDistOrNumber); +normal: (frValueDistOrNumber, frValueDistOrNumber) => distribution; ``` ```javascript -normal: (dict<{p5: frValueDistOrNumber, p95: frValueDistOrNumber}>) +normal: (dict<{p5: frValueDistOrNumber, p95: frValueDistOrNumber}>) => distribution ``` ```javascript -normal: (dict<{mean: frValueDistOrNumber, stdev: frValueDistOrNumber}>) +normal: (dict<{mean: frValueDistOrNumber, stdev: frValueDistOrNumber}>) => distribution ``` **Examples** @@ -38,15 +38,15 @@ normal({ mean: 5, stdev: 2 }); **Definitions** ```javascript -lognormal: (frValueDistOrNumber, frValueDistOrNumber); +lognormal: (frValueDistOrNumber, frValueDistOrNumber) => distribution; ``` ```javascript -lognormal: (dict<{p5: frValueDistOrNumber, p95: frValueDistOrNumber}>) +lognormal: (dict<{p5: frValueDistOrNumber, p95: frValueDistOrNumber}>) => distribution ``` ```javascript -lognormal: (dict<{mean: frValueDistOrNumber, stdev: frValueDistOrNumber}>) +lognormal: (dict<{mean: frValueDistOrNumber, stdev: frValueDistOrNumber}>) => distribution ``` **Examples** @@ -62,7 +62,7 @@ lognormal({ mean: 5, stdev: 2 }); **Definitions** ```javascript -uniform: (frValueDistOrNumber, frValueDistOrNumber); +uniform: (frValueDistOrNumber, frValueDistOrNumber) => distribution; ``` **Examples** @@ -76,7 +76,7 @@ uniform(10, 12); **Definitions** ```javascript -beta: (frValueDistOrNumber, frValueDistOrNumber); +beta: (frValueDistOrNumber, frValueDistOrNumber) => distribution; ``` **Examples** @@ -90,7 +90,7 @@ beta(20, 25); **Definitions** ```javascript -cauchy: (frValueDistOrNumber, frValueDistOrNumber); +cauchy: (frValueDistOrNumber, frValueDistOrNumber) => distribution; ``` **Examples** @@ -104,7 +104,7 @@ cauchy(5, 1); **Definitions** ```javascript -gamma: (frValueDistOrNumber, frValueDistOrNumber); +gamma: (frValueDistOrNumber, frValueDistOrNumber) => distribution; ``` **Examples** @@ -118,7 +118,7 @@ gamma(5, 1); **Definitions** ```javascript -logistic: (frValueDistOrNumber, frValueDistOrNumber); +logistic: (frValueDistOrNumber, frValueDistOrNumber) => distribution; ``` **Examples** @@ -132,11 +132,11 @@ gamma(5, 1); **Definitions** ```javascript -to: (frValueDistOrNumber, frValueDistOrNumber); +to: (frValueDistOrNumber, frValueDistOrNumber) => distribution; ``` ```javascript -credibleIntervalToDistribution(frValueDistOrNumber, frValueDistOrNumber); +credibleIntervalToDistribution(frValueDistOrNumber, frValueDistOrNumber) => distribution; ``` **Examples** @@ -152,7 +152,7 @@ to(5,10) **Definitions** ```javascript -exponential: (frValueDistOrNumber); +exponential: (frValueDistOrNumber) => distribution; ``` **Examples** @@ -166,7 +166,7 @@ exponential(2); **Definitions** ```javascript -bernoulli: (frValueDistOrNumber); +bernoulli: (frValueDistOrNumber) => distribution; ``` **Examples** @@ -182,7 +182,7 @@ Converts a set of points to a continuous distribution **Definitions** ```javascript -toContinuousPointSet: (array>) +toContinuousPointSet: (array>) => distribution ``` **Examples** @@ -203,7 +203,7 @@ Converts a set of points to a discrete distribution **Definitions** ```javascript -toDiscretePointSet: (array>) +toDiscretePointSet: (array>) => distribution ``` **Examples** @@ -251,7 +251,7 @@ sample(normal(5, 2)); Get n random samples from the distribution ```javascript -sampleN: (distribution, number):list +sampleN: (distribution, number) => list ``` **Examples** @@ -313,7 +313,7 @@ pdf: (distribution, number) => number **Examples** ```javascript -pdf: (normal(5, 2), 3); +pdf(normal(5, 2), 3); ``` ### inv @@ -333,7 +333,7 @@ inv(normal(5, 2), 0.5); Converts a distribution to the pointSet format ```javascript -toPointSet: (distribution):pointSetDistribution +toPointSet: (distribution) => pointSetDistribution ``` **Examples** @@ -347,7 +347,7 @@ toPointSet(normal(5, 2)); Converts a distribution to the sampleSet format, with n samples ```javascript -toSampleSet: (distribution,number):sampleSetDistribution +toSampleSet: (distribution,number) => sampleSetDistribution ``` **Examples** @@ -405,7 +405,7 @@ klDivergence(normal(5, 2), normal(5, 4)); // returns 0.57 ### toString ```javascript -: (distribution) => string +toString: (distribution) => string ``` **Examples** @@ -463,7 +463,7 @@ normalize(normal(5, 2)); Check of a distribution is normalized. Most distributions are typically normalized, but there are some commands that could produce non-normalized distributions. ```javascript -isNormalized: (distribution):bool +isNormalized: (distribution) => bool ``` **Examples** @@ -631,7 +631,7 @@ scaleLog10: (distributionLike, number) => distribution Adds metadata to a function of the input ranges. Works now for numeric and date inputs. This is useful when making predictions. It allows you to limit the domain that your prediction will be used and scored within. ```javascript -declareFn: (dict<{fn: lambda, inputs: array>}>) +declareFn: (dict<{fn: lambda, inputs: array>}>) => declaration ``` **Examples** From afb69e2e06ce165e8922248af99fc0ace1b7ce0f Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Sat, 11 Jun 2022 08:57:02 -0700 Subject: [PATCH 12/20] Format on website --- packages/website/docs/Api/Date.md | 4 +- packages/website/docs/Api/Dictionary.md | 35 +++++++--- packages/website/docs/Api/DistGeneric.mdx | 78 +++++++++++----------- packages/website/docs/Api/DistPointSet.md | 5 +- packages/website/docs/Api/DistSampleSet.md | 12 ++-- packages/website/docs/Api/Duration.mdx | 15 ++++- packages/website/docs/Api/List.md | 37 ++++++---- packages/website/docs/Api/Math.md | 42 +++++++++--- packages/website/docs/Api/Number.mdx | 28 ++++---- packages/website/sidebars.js | 4 +- 10 files changed, 163 insertions(+), 97 deletions(-) diff --git a/packages/website/docs/Api/Date.md b/packages/website/docs/Api/Date.md index cd6c766d..4c50f582 100644 --- a/packages/website/docs/Api/Date.md +++ b/packages/website/docs/Api/Date.md @@ -27,8 +27,8 @@ subtract: (date, duration) => date ``` ```js -makeFromYear(2040) - makeFromYear(2020) // 20 years -makeFromYear(2040) - years(20) // 2020 +makeFromYear(2040) - makeFromYear(2020); // 20 years +makeFromYear(2040) - years(20); // 2020 ``` ### add diff --git a/packages/website/docs/Api/Dictionary.md b/packages/website/docs/Api/Dictionary.md index a31ba8ad..136342d2 100644 --- a/packages/website/docs/Api/Dictionary.md +++ b/packages/website/docs/Api/Dictionary.md @@ -2,57 +2,70 @@ sidebar_position: 2 title: Dictionary --- + ### toList + ``` Dict.toList: (dict<'a>) => list> ``` ```js -Dict.toList({foo: 3, bar: 20}) // [["foo", 3], ["bar", 20]] +Dict.toList({ foo: 3, bar: 20 }); // [["foo", 3], ["bar", 20]] ``` ### fromList + ``` Dict.fromList: (list>) => dict<'a> ``` + ```js -Dict.fromList([["foo", 3], ["bar", 20]]) // {foo: 3, bar: 20} +Dict.fromList([ + ["foo", 3], + ["bar", 20], +]); // {foo: 3, bar: 20} ``` ### keys + ``` Dict.keys: (dict<'a>) => list ``` + ```js -Dict.keys({foo: 3, bar: 20}) // ["foo", "bar"] +Dict.keys({ foo: 3, bar: 20 }); // ["foo", "bar"] ``` ### values + ``` Dict.values: (dict<'a>) => list<'a> ``` + ```js -Dict.values({foo: 3, bar: 20}) // [3, 20] +Dict.values({ foo: 3, bar: 20 }); // [3, 20] ``` ### merge + ``` Dict.merge: (dict<'a>, dict<'b>) => dict<'a|b> ``` ```js -first = {a: 1, b: 2} -snd = {b: 3, c: 5} -Dict.merge(first, snd) // {a: 1, b: 3, c: 5} +first = { a: 1, b: 2 }; +snd = { b: 3, c: 5 }; +Dict.merge(first, snd); // {a: 1, b: 3, c: 5} ``` ### mergeMany + ``` Dict.mergeMany: (list>) => dict<'a> ``` ```js -first = {a: 1, b: 2} -snd = {b: 3, c: 5} -Dict.mergeMany([first, snd]) // {a: 1, b: 3, c: 5} -``` \ No newline at end of file +first = { a: 1, b: 2 }; +snd = { b: 3, c: 5 }; +Dict.mergeMany([first, snd]); // {a: 1, b: 3, c: 5} +``` diff --git a/packages/website/docs/Api/DistGeneric.mdx b/packages/website/docs/Api/DistGeneric.mdx index 17dfdc4e..d70476e5 100644 --- a/packages/website/docs/Api/DistGeneric.mdx +++ b/packages/website/docs/Api/DistGeneric.mdx @@ -257,7 +257,7 @@ sampleN: (distribution, number) => list **Examples** ```javascript -sample: (normal(5, 2), 100); +sample: normal(5, 2), 100; ``` ### mean @@ -265,49 +265,49 @@ sample: (normal(5, 2), 100); Get the distribution mean ```javascript -mean: (distribution) => number +mean: (distribution) => number; ``` **Examples** ```javascript -mean: (normal(5, 2)); +mean: normal(5, 2); ``` ### stdev ```javascript -stdev: (distribution) => number +stdev: (distribution) => number; ``` ### variance ```javascript -variance: (distribution) => number +variance: (distribution) => number; ``` ### mode ```javascript -mode: (distribution) => number +mode: (distribution) => number; ``` ### cdf ```javascript -cdf: (distribution, number) => number +cdf: (distribution, number) => number; ``` **Examples** ```javascript -cdf: (normal(5, 2), 3); +cdf: normal(5, 2), 3; ``` ### pdf ```javascript -pdf: (distribution, number) => number +pdf: (distribution, number) => number; ``` **Examples** @@ -319,7 +319,7 @@ pdf(normal(5, 2), 3); ### inv ```javascript -inv: (distribution, number) => number +inv: (distribution, number) => number; ``` **Examples** @@ -333,7 +333,7 @@ inv(normal(5, 2), 0.5); Converts a distribution to the pointSet format ```javascript -toPointSet: (distribution) => pointSetDistribution +toPointSet: (distribution) => pointSetDistribution; ``` **Examples** @@ -347,7 +347,7 @@ toPointSet(normal(5, 2)); Converts a distribution to the sampleSet format, with n samples ```javascript -toSampleSet: (distribution,number) => sampleSetDistribution +toSampleSet: (distribution, number) => sampleSetDistribution; ``` **Examples** @@ -391,7 +391,7 @@ truncateLeft(normal(5, 2), 6); Kullback–Leibler divergence between two distributions ```javascript -klDivergence: (distribution, distribution) => number +klDivergence: (distribution, distribution) => number; ``` **Examples** @@ -405,7 +405,7 @@ klDivergence(normal(5, 2), normal(5, 4)); // returns 0.57 ### toString ```javascript -toString: (distribution) => string +toString: (distribution) => string; ``` **Examples** @@ -419,7 +419,7 @@ toString(normal(5, 2)); Produce a sparkline of length n ```javascript -toSparkline: (distribution, n=20) => string +toSparkline: (distribution, n = 20) => string; ``` **Examples** @@ -433,7 +433,7 @@ toSparkline(normal(5, 2), 10); Prints the value of the distribution to the Javascript console, then returns the distribution. ```javascript -inspect: (distribution) => distribution +inspect: (distribution) => distribution; ``` **Examples** @@ -449,7 +449,7 @@ inspect(normal(5, 2)); Normalize a distribution. This means scaling it appropriately so that it's cumulative sum is equal to 1. ```javascript -normalize: (distribution) => distribution +normalize: (distribution) => distribution; ``` **Examples** @@ -463,7 +463,7 @@ normalize(normal(5, 2)); Check of a distribution is normalized. Most distributions are typically normalized, but there are some commands that could produce non-normalized distributions. ```javascript -isNormalized: (distribution) => bool +isNormalized: (distribution) => bool; ``` **Examples** @@ -477,7 +477,7 @@ isNormalized(normal(5, 2)); // returns true Get the sum of the integral of a distribution. If the distribution is normalized, this will be 1. ```javascript -integralSum: (distribution) => number +integralSum: (distribution) => number; ``` **Examples** @@ -491,7 +491,7 @@ integralSum(normal(5, 2)); ### add ```javascript -add: (distributionLike, distributionLike) => distribution +add: (distributionLike, distributionLike) => distribution; ``` ### sum @@ -503,7 +503,7 @@ sum: (list) => distribution ### multiply ```javascript -multiply: (distributionLike, distributionLike) => distribution +multiply: (distributionLike, distributionLike) => distribution; ``` ### product @@ -515,43 +515,43 @@ product: (list) => distribution ### subtract ```javascript -subtract: (distributionLike, distributionLike) => distribution +subtract: (distributionLike, distributionLike) => distribution; ``` ### divide ```javascript -divide: (distributionLike, distributionLike) => distribution +divide: (distributionLike, distributionLike) => distribution; ``` ### pow ```javascript -pow: (distributionLike, distributionLike) => distribution +pow: (distributionLike, distributionLike) => distribution; ``` ### exp ```javascript -exp: (distributionLike, distributionLike) => distribution +exp: (distributionLike, distributionLike) => distribution; ``` ### log ```javascript -log: (distributionLike, distributionLike) => distribution +log: (distributionLike, distributionLike) => distribution; ``` ### log10 ```javascript -log10: (distributionLike, distributionLike) => distribution +log10: (distributionLike, distributionLike) => distribution; ``` ### unaryMinus ```javascript -unaryMinus: (distribution) => distribution +unaryMinus: (distribution) => distribution; ``` ## Pointwise Operations @@ -559,37 +559,37 @@ unaryMinus: (distribution) => distribution ### dotAdd ```javascript -dotAdd: (distributionLike, distributionLike) => distribution +dotAdd: (distributionLike, distributionLike) => distribution; ``` ### dotMultiply ```javascript -dotMultiply: (distributionLike, distributionLike) => distribution +dotMultiply: (distributionLike, distributionLike) => distribution; ``` ### dotSubtract ```javascript -dotSubtract: (distributionLike, distributionLike) => distribution +dotSubtract: (distributionLike, distributionLike) => distribution; ``` ### dotDivide ```javascript -dotDivide: (distributionLike, distributionLike) => distribution +dotDivide: (distributionLike, distributionLike) => distribution; ``` ### dotPow ```javascript -dotPow: (distributionLike, distributionLike) => distribution +dotPow: (distributionLike, distributionLike) => distribution; ``` ### dotExp ```javascript -dotExp: (distributionLike, distributionLike) => distribution +dotExp: (distributionLike, distributionLike) => distribution; ``` ## Scale Operations @@ -597,31 +597,31 @@ dotExp: (distributionLike, distributionLike) => distribution ### scaleMultiply ```javascript -scaleMultiply: (distributionLike, number) => distribution +scaleMultiply: (distributionLike, number) => distribution; ``` ### scalePow ```javascript -scalePow: (distributionLike, number) => distribution +scalePow: (distributionLike, number) => distribution; ``` ### scaleExp ```javascript -scaleExp: (distributionLike, number) => distribution +scaleExp: (distributionLike, number) => distribution; ``` ### scaleLog ```javascript -scaleLog: (distributionLike, number) => distribution +scaleLog: (distributionLike, number) => distribution; ``` ### scaleLog10 ```javascript -scaleLog10: (distributionLike, number) => distribution +scaleLog10: (distributionLike, number) => distribution; ``` ## Special diff --git a/packages/website/docs/Api/DistPointSet.md b/packages/website/docs/Api/DistPointSet.md index f5336d24..bf65ad68 100644 --- a/packages/website/docs/Api/DistPointSet.md +++ b/packages/website/docs/Api/DistPointSet.md @@ -4,16 +4,19 @@ title: Point Set Distribution --- ### make + ``` PointSet.make: (distribution) => pointSetDist ``` ### makeContinuous + ``` PointSet.makeContinuous: (list<{x: number, y: number}>) => pointSetDist ``` ### makeDiscrete + ``` PointSet.makeDiscrete: (list<{x: number, y: number}>) => pointSetDist -``` \ No newline at end of file +``` diff --git a/packages/website/docs/Api/DistSampleSet.md b/packages/website/docs/Api/DistSampleSet.md index bf489ecf..9d0f5ed9 100644 --- a/packages/website/docs/Api/DistSampleSet.md +++ b/packages/website/docs/Api/DistSampleSet.md @@ -4,6 +4,7 @@ title: Sample Set Distribution --- ### make + ``` SampleSet.make: (distribution) => sampleSet SampleSet.make: (() => number) => sampleSet @@ -11,30 +12,33 @@ SampleSet.make: (list) => sampleSet ``` ### map + ``` SampleSet.map: (sampleSet, (number => number)) => sampleSet ``` - ### map2 + ``` SampleSet.map2: (sampleSet, sampleSet, ((number, number) => number)) => sampleSet ``` ### map3 + ``` SampleSet.map3: (sampleSet, sampleSet, sampleSet, ((number, number, number) => number)) => sampleSet ``` - ### toList + ``` SampleSet.toList: (sampleSet) => list ``` + Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toList() maintains order and length. Gets the internal samples of a sampleSet distribution. This is separate from the sampleN() function, which would shuffle the samples. toList() maintains order and length. - **Examples** + ``` toList(toSampleSet(normal(5,2))) -``` \ No newline at end of file +``` diff --git a/packages/website/docs/Api/Duration.mdx b/packages/website/docs/Api/Duration.mdx index 52c50130..6f81a352 100644 --- a/packages/website/docs/Api/Duration.mdx +++ b/packages/website/docs/Api/Duration.mdx @@ -8,6 +8,7 @@ import TOCInline from "@theme/TOCInline"; ### toString + ``` toString: (duration) => string ``` @@ -15,41 +16,49 @@ toString: (duration) => string ## Units ### minutes + ``` minutes: (number) => duration ``` ### hours + ``` hours: (number) => duration ``` ### days + ``` days: (number) => duration ``` ### years + ``` years: (number) => duration ``` ### toHours + ``` toHours: (duration) => number ``` ### toMinutes + ``` toMinutes: (duration) => number ``` ### toDays + ``` toDays: (duration) => number ``` ### toYears + ``` toYears: (duration) => number ``` @@ -57,21 +66,25 @@ toYears: (duration) => number ## Algebra ### add + ``` add: (duration, duration) => duration ``` ### subtract + ``` subtract: (duration, duration) => duration ``` ### multiply + ``` multiply: (duration, number) => duration ``` ### divide + ``` divide: (duration, number) => duration -``` \ No newline at end of file +``` diff --git a/packages/website/docs/Api/List.md b/packages/website/docs/Api/List.md index 9a1e880b..c6d89e7d 100644 --- a/packages/website/docs/Api/List.md +++ b/packages/website/docs/Api/List.md @@ -4,53 +4,63 @@ title: List --- ### make + ``` List.make: (number, 'a) => list<'a> ``` -Returns an array of size ``n`` filled with value ``e``. + +Returns an array of size `n` filled with value `e`. ```js -List.make(4, 1) // creates the list [1, 1, 1, 1] +List.make(4, 1); // creates the list [1, 1, 1, 1] ``` See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/belt/array#make) ### toString + ``` toString: (list<'a>) => string ``` ### length + ``` length: (list<'a>) => number ``` ### up to + ``` List.upTo: (low:number, high:number) => list ``` + ```js -List.upTo(0, 5) // creates the list [0, 1, 2, 3, 4, 5] +List.upTo(0, 5); // creates the list [0, 1, 2, 3, 4, 5] ``` -Syntax taken from [Ruby](https://apidock.com/ruby/v2_5_5/Integer/upto). +Syntax taken from [Ruby](https://apidock.com/ruby/v2_5_5/Integer/upto). ### first + ``` first: (list<'a>) => 'a ``` ### last + ``` last: (list<'a>) => 'a ``` ### reverse + ``` reverse: (list<'a>) => list<'a> ``` ### map + ``` map: (list<'a>, a => b) => list<'b> ``` @@ -58,12 +68,14 @@ map: (list<'a>, a => b) => list<'b> See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/belt/array#map). ### reduce -``` -reduce: (list<'b>, 'a, ('a, 'b) => 'a) => 'a -``` -``reduce(arr, init, f)`` -Applies ``f`` to each element of ``arr``. The function ``f`` has two paramaters, an accumulator and the next value from the array. +``` +reduce: (list<'b>, 'a, ('a, 'b) => 'a) => 'a +``` + +`reduce(arr, init, f)` + +Applies `f` to each element of `arr`. The function `f` has two paramaters, an accumulator and the next value from the array. ```js reduce([2, 3, 4], 1, {|acc, value| acc + value}) == 10 @@ -72,10 +84,11 @@ reduce([2, 3, 4], 1, {|acc, value| acc + value}) == 10 See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/belt/array#reduce). ### reduce reverse + ``` -reduceReverse: (list<'b>, 'a, ('a, 'b) => 'a) => 'a +reduceReverse: (list<'b>, 'a, ('a, 'b) => 'a) => 'a ``` -Works like ``reduce``, but the function is applied to each item from the last back to the first. +Works like `reduce`, but the function is applied to each item from the last back to the first. -See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/belt/array#reducereverse). \ No newline at end of file +See [Rescript implementation](https://rescript-lang.org/docs/manual/latest/api/belt/array#reducereverse). diff --git a/packages/website/docs/Api/Math.md b/packages/website/docs/Api/Math.md index e64d6352..37f3fe1d 100644 --- a/packages/website/docs/Api/Math.md +++ b/packages/website/docs/Api/Math.md @@ -4,61 +4,81 @@ title: Math --- ### E + ``` -Math.E: +Math.E: ``` + Euler's number; ≈ 2.718281828459045 ### LN2 + ``` -Math.LN2: +Math.LN2: ``` + Natural logarithm of 2; ≈ 0.6931471805599453 ### LN10 + ``` -Math.LN10: +Math.LN10: ``` + Natural logarithm of 10; ≈ 2.302585092994046 ### LOG2E + ``` -Math.LOG2E: +Math.LOG2E: ``` + Base 2 logarithm of E; ≈ 1.4426950408889634Base 2 logarithm of E; ≈ 1.4426950408889634 ### LOG10E + ``` -Math.LOG10E: +Math.LOG10E: ``` + Base 10 logarithm of E; ≈ 0.4342944819032518 ### PI + ``` -Math.PI: +Math.PI: ``` + Pi - ratio of the circumference to the diameter of a circle; ≈ 3.141592653589793 ### SQRT1_2 + ``` -Math.SQRT1_2: +Math.SQRT1_2: ``` + Square root of 1/2; ≈ 0.7071067811865476 ### SQRT2 + ``` -Math.SQRT2: +Math.SQRT2: ``` + Square root of 2; ≈ 1.4142135623730951 ### PHI + ``` -Math.PHI: +Math.PHI: ``` + Phi is the golden ratio. 1.618033988749895 ### TAU + ``` -Math.TAU: +Math.TAU: ``` -Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi. 6.283185307179586 + +Tau is the ratio constant of a circle's circumference to radius, equal to 2 \* pi. 6.283185307179586 diff --git a/packages/website/docs/Api/Number.mdx b/packages/website/docs/Api/Number.mdx index e544b4f6..6e4015c2 100644 --- a/packages/website/docs/Api/Number.mdx +++ b/packages/website/docs/Api/Number.mdx @@ -10,25 +10,25 @@ import TOCInline from "@theme/TOCInline"; ### ceil ```javascript -ceil: (number) => number +ceil: (number) => number; ``` ### floor ```javascript -floor: (number) => number +floor: (number) => number; ``` ### abs ```javascript -abs: (number) => number +abs: (number) => number; ``` ### round ```javascript -round: (number) => number +round: (number) => number; ``` ## Statistics @@ -68,19 +68,19 @@ variance: (list) => number ### unaryMinus ```javascript -unaryMinus: (number) => number +unaryMinus: (number) => number; ``` ### equal ```javascript -equal: (number, number) => boolean +equal: (number, number) => boolean; ``` ### add ```javascript -add: (number, number) => number +add: (number, number) => number; ``` ### sum @@ -98,7 +98,7 @@ cumsum: (list) => list ### multiply ```javascript -multiply: (number, number) => number +multiply: (number, number) => number; ``` ### product @@ -116,29 +116,29 @@ cumprod: (list) => list ### subtract ```javascript -subtract: (number, number) => number +subtract: (number, number) => number; ``` ### divide ```javascript -divide: (number, number) => number +divide: (number, number) => number; ``` ### pow ```javascript -pow: (number, number) => number +pow: (number, number) => number; ``` ### exp ```javascript -exp: (number) => number +exp: (number) => number; ``` ### log ```javascript -log: (number) => number -``` \ No newline at end of file +log: (number) => number; +``` diff --git a/packages/website/sidebars.js b/packages/website/sidebars.js index 55b9b1a6..5c63ccb9 100644 --- a/packages/website/sidebars.js +++ b/packages/website/sidebars.js @@ -16,8 +16,8 @@ const sidebars = { // By default, Docusaurus generates a sidebar from the docs folder structure apiSidebar: [ { - type: 'autogenerated', - dirName: 'Api', + type: "autogenerated", + dirName: "Api", }, ], tutorialSidebar: [ From 0a6c24429e72639b10ff00c97646b646598ef654 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 14:29:09 +0000 Subject: [PATCH 13/20] :arrow_up: Bump tailwindcss from 3.0.24 to 3.1.2 Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 3.0.24 to 3.1.2. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v3.0.24...v3.1.2) --- updated-dependencies: - dependency-name: tailwindcss dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index e5023e10..8a5f31f8 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -48,7 +48,7 @@ "postcss-loader": "^7.0.0", "react-scripts": "^5.0.1", "style-loader": "^3.3.1", - "tailwindcss": "^3.0.24", + "tailwindcss": "^3.1.2", "ts-loader": "^9.3.0", "tsconfig-paths-webpack-plugin": "^3.5.2", "typescript": "^4.7.3", diff --git a/yarn.lock b/yarn.lock index 3b52c384..2b368c84 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7742,7 +7742,7 @@ detect-port@^1.3.0: address "^1.0.1" debug "^2.6.0" -detective@^5.2.0: +detective@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/detective/-/detective-5.2.1.tgz#6af01eeda11015acb0e73f933242b70f24f91034" integrity sha512-v9XE1zRnz1wRtgurGu0Bs8uHKFSTdteYZNbIPFVhUZ39L/S79ppMpdmVOZAnoz1jfEFodc48n6MX483Xo3t1yw== @@ -13976,7 +13976,7 @@ postcss@^7.0.14, postcss@^7.0.26, postcss@^7.0.32, postcss@^7.0.35, postcss@^7.0 picocolors "^0.2.1" source-map "^0.6.1" -postcss@^8.2.15, postcss@^8.3.11, postcss@^8.3.5, postcss@^8.4.12, postcss@^8.4.13, postcss@^8.4.14, postcss@^8.4.4, postcss@^8.4.7: +postcss@^8.2.15, postcss@^8.3.11, postcss@^8.3.5, postcss@^8.4.13, postcss@^8.4.14, postcss@^8.4.4, postcss@^8.4.7: version "8.4.14" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf" integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig== @@ -16426,15 +16426,15 @@ synchronous-promise@^2.0.15: resolved "https://registry.yarnpkg.com/synchronous-promise/-/synchronous-promise-2.0.15.tgz#07ca1822b9de0001f5ff73595f3d08c4f720eb8e" integrity sha512-k8uzYIkIVwmT+TcglpdN50pS2y1BDcUnBPK9iJeGu0Pl1lOI8pD6wtzgw91Pjpe+RxtTncw32tLxs/R0yNL2Mg== -tailwindcss@^3.0.2, tailwindcss@^3.0.24: - version "3.0.24" - resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.0.24.tgz#22e31e801a44a78a1d9a81ecc52e13b69d85704d" - integrity sha512-H3uMmZNWzG6aqmg9q07ZIRNIawoiEcNFKDfL+YzOPuPsXuDXxJxB9icqzLgdzKNwjG3SAro2h9SYav8ewXNgig== +tailwindcss@^3.0.2, tailwindcss@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.1.2.tgz#b5607d17adb6cbb11a13738cc5fdf3e5527dcd7a" + integrity sha512-yJ6L5s1U5AeS5g7HHy212zdQfjwD426FBfm59pet/JsyneuZuD4C2W7PpJEg4ppisiB21uLqtNagv8KXury3+Q== dependencies: arg "^5.0.1" chokidar "^3.5.3" color-name "^1.1.4" - detective "^5.2.0" + detective "^5.2.1" didyoumean "^1.2.2" dlv "^1.1.3" fast-glob "^3.2.11" @@ -16444,7 +16444,8 @@ tailwindcss@^3.0.2, tailwindcss@^3.0.24: normalize-path "^3.0.0" object-hash "^3.0.0" picocolors "^1.0.0" - postcss "^8.4.12" + postcss "^8.4.14" + postcss-import "^14.1.0" postcss-js "^4.0.0" postcss-load-config "^3.1.4" postcss-nested "5.0.6" From b7402a3b09c680a17cc4580c0af0aad5de17f5a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 14:30:23 +0000 Subject: [PATCH 14/20] :arrow_up: Bump react-hook-form from 7.31.3 to 7.32.0 Bumps [react-hook-form](https://github.com/react-hook-form/react-hook-form) from 7.31.3 to 7.32.0. - [Release notes](https://github.com/react-hook-form/react-hook-form/releases) - [Changelog](https://github.com/react-hook-form/react-hook-form/blob/master/CHANGELOG.md) - [Commits](https://github.com/react-hook-form/react-hook-form/compare/v7.31.3...v7.32.0) --- updated-dependencies: - dependency-name: react-hook-form dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index e5023e10..150e6d1e 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -12,7 +12,7 @@ "react": "^18.1.0", "react-ace": "^10.1.0", "react-dom": "^18.1.0", - "react-hook-form": "^7.31.3", + "react-hook-form": "^7.32.0", "react-use": "^17.4.0", "react-vega": "^7.5.1", "vega": "^5.22.1", diff --git a/yarn.lock b/yarn.lock index 3b52c384..0789f3fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14484,10 +14484,10 @@ react-helmet-async@*, react-helmet-async@^1.3.0: react-fast-compare "^3.2.0" shallowequal "^1.1.0" -react-hook-form@^7.31.3: - version "7.31.3" - resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.31.3.tgz#b61bafb9a7435f91695351a7a9f714d8c4df0121" - integrity sha512-NVZdCWViIWXXXlQ3jxVQH0NuNfwPf8A/0KvuCxrM9qxtP1qYosfR2ZudarziFrVOC7eTUbWbm1T4OyYCwv9oSQ== +react-hook-form@^7.32.0: + version "7.32.0" + resolved "https://registry.yarnpkg.com/react-hook-form/-/react-hook-form-7.32.0.tgz#bfe36000e3a9fa605a4e3e9a029282feb094ef6a" + integrity sha512-AFUwl9MwVVnZZsFZW7Egc8PVyWem6c6/9FBq29Acsikm+8ecJCkqOn2Tl48GApFnXBgoBBEHC3zosjYvPfsGNg== react-inspector@^5.1.0: version "5.1.1" From ed3b1c3ddcf239bfa29e7c8b1f1c83605b05ab39 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 14:30:53 +0000 Subject: [PATCH 15/20] :arrow_up: Bump @hookform/resolvers from 2.9.0 to 2.9.1 Bumps [@hookform/resolvers](https://github.com/react-hook-form/resolvers) from 2.9.0 to 2.9.1. - [Release notes](https://github.com/react-hook-form/resolvers/releases) - [Commits](https://github.com/react-hook-form/resolvers/compare/v2.9.0...v2.9.1) --- updated-dependencies: - dependency-name: "@hookform/resolvers" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index e5023e10..a88533ea 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -5,7 +5,7 @@ "dependencies": { "@headlessui/react": "^1.6.4", "@heroicons/react": "^1.0.6", - "@hookform/resolvers": "^2.9.0", + "@hookform/resolvers": "^2.9.1", "@quri/squiggle-lang": "^0.2.8", "@react-hook/size": "^2.1.2", "lodash": "^4.17.21", diff --git a/yarn.lock b/yarn.lock index 3b52c384..457d5165 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1852,10 +1852,10 @@ resolved "https://registry.yarnpkg.com/@heroicons/react/-/react-1.0.6.tgz#35dd26987228b39ef2316db3b1245c42eb19e324" integrity sha512-JJCXydOFWMDpCP4q13iEplA503MQO3xLoZiKum+955ZCtHINWnx26CUxVxxFQu/uLb4LW3ge15ZpzIkXKkJ8oQ== -"@hookform/resolvers@^2.9.0": - version "2.9.0" - resolved "https://registry.yarnpkg.com/@hookform/resolvers/-/resolvers-2.9.0.tgz#0e8c5188fb030f1c21764892db0d04058d5413f0" - integrity sha512-fW/buf863gDiU60RxCTKooJRf1YRvcMy0MTXGsyv7y0sutx0iYeZwoFNQRLBtS+hi+lo60ZV3Kf8AdqGY+sZVw== +"@hookform/resolvers@^2.9.1": + version "2.9.1" + resolved "https://registry.yarnpkg.com/@hookform/resolvers/-/resolvers-2.9.1.tgz#59121e38d8fc95d2fd1f41c9631393cd21e10b65" + integrity sha512-80lyFFcExEB7A09PFnl8k7A3obQyDF6MyO/FThtwetk+MTedYMs08Aqf7mgWnOawFGyz5QF+TZXJSYiIZW2tEg== "@humanwhocodes/config-array@^0.9.2": version "0.9.5" From 8aef1987add3178bd4ee3c0d8e30b63d65da2cfb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 14:31:20 +0000 Subject: [PATCH 16/20] :arrow_up: Bump @storybook/addon-links from 6.5.7 to 6.5.8 Bumps [@storybook/addon-links](https://github.com/storybookjs/storybook/tree/HEAD/addons/links) from 6.5.7 to 6.5.8. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.8/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.8/addons/links) --- updated-dependencies: - dependency-name: "@storybook/addon-links" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- yarn.lock | 98 +++++++++++++++++++++++++++++--- 2 files changed, 91 insertions(+), 9 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index e5023e10..f9c24163 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -24,7 +24,7 @@ "@babel/plugin-proposal-private-property-in-object": "^7.17.12", "@storybook/addon-actions": "^6.5.7", "@storybook/addon-essentials": "^6.5.7", - "@storybook/addon-links": "^6.5.7", + "@storybook/addon-links": "^6.5.8", "@storybook/builder-webpack5": "^6.5.7", "@storybook/manager-webpack5": "^6.5.7", "@storybook/node-logger": "^6.5.6", diff --git a/yarn.lock b/yarn.lock index 3b52c384..b4c20870 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2880,16 +2880,16 @@ regenerator-runtime "^0.13.7" ts-dedent "^2.0.0" -"@storybook/addon-links@^6.5.7": - version "6.5.7" - resolved "https://registry.yarnpkg.com/@storybook/addon-links/-/addon-links-6.5.7.tgz#b3a794b19c5c0277c3f20f86915c851f577dc45b" - integrity sha512-kiCzGLlCyhfBjwYfM/xACe5l6s2+8exQNOGoLzNeAhprgD7dzpsZ0ZaEgpF4ay9bG9H9gOeX4jc/TAvVW/v6nw== +"@storybook/addon-links@^6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/addon-links/-/addon-links-6.5.8.tgz#ec4b640bf89dbb653592e6f05968ba771bb10b4a" + integrity sha512-UxzEPnT1PLPsuy3tt+o3UJTbI4Kihec+/yzpzzGKreUnCC8EWTsOhtMQAVVit2t4BMl4vNrxKO0mKSc8saT3Gw== dependencies: - "@storybook/addons" "6.5.7" - "@storybook/client-logger" "6.5.7" - "@storybook/core-events" "6.5.7" + "@storybook/addons" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/router" "6.5.7" + "@storybook/router" "6.5.8" "@types/qs" "^6.9.5" core-js "^3.8.2" global "^4.4.0" @@ -2975,6 +2975,23 @@ global "^4.4.0" regenerator-runtime "^0.13.7" +"@storybook/addons@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-6.5.8.tgz#c529a2989830a09d26308277a3e356228479053d" + integrity sha512-L3LmbsYP9tDHHvpr/yv8YuEkzym7SXp/jZ0km31tpG3EuZmgGu7MXPrZ2ymEw4PkAhQzztgRr23VTfKobGUojA== + dependencies: + "@storybook/api" "6.5.8" + "@storybook/channels" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/router" "6.5.8" + "@storybook/theming" "6.5.8" + "@types/webpack-env" "^1.16.0" + core-js "^3.8.2" + global "^4.4.0" + regenerator-runtime "^0.13.7" + "@storybook/api@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.7.tgz#1a5fc381fd417fd1c8ab6e246af09fdcd20f9df0" @@ -2998,6 +3015,29 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" +"@storybook/api@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.8.tgz#8bd400b8a5b18ec6bff5d35a898593d9c1c630f9" + integrity sha512-/MueV+wLCvy9gFA3ih4g7QYjDmn14i+D2ydonfaEC7R+agFGXxXwJGPKkz3yBNrRpNkBwcbY9mAmv8lE2AqgqQ== + dependencies: + "@storybook/channels" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/router" "6.5.8" + "@storybook/semver" "^7.3.2" + "@storybook/theming" "6.5.8" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.21" + memoizerific "^1.11.3" + regenerator-runtime "^0.13.7" + store2 "^2.12.0" + telejson "^6.0.8" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/builder-webpack4@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/builder-webpack4/-/builder-webpack4-6.5.7.tgz#043ad0625eedb39fcd07035cdb252973d3eb6ef9" @@ -3128,6 +3168,15 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" +"@storybook/channels@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.5.8.tgz#e85ffd2076813b67336b1b9b274c37aa5f1b80e0" + integrity sha512-fNql1lEIvWlI1NiRtwFMWOOvfW6qxgeSP6xoqiAJ0b+QYegEFG9UxJDuEvVHq++S81FulgQ5U+p+5R9XSV19tQ== + dependencies: + core-js "^3.8.2" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/client-api@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-6.5.7.tgz#e5d7a5ca698138f4eba36e14d49138850163f252" @@ -3162,6 +3211,14 @@ core-js "^3.8.2" global "^4.4.0" +"@storybook/client-logger@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.5.8.tgz#551f818c4448ef6e6adf9c3ad256e1ae61e2d75c" + integrity sha512-dH6HSaVuOIMHy1+rpsqcD3SJxVZEEbuEtsNpdUGwLJaIuduhUJJpM2xQfUW0siZDyrgwoa+znll+G0YNUbv7sg== + dependencies: + core-js "^3.8.2" + global "^4.4.0" + "@storybook/components@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.5.7.tgz#28a509c0556f8df919c8c7f7076ca6785b22cb8d" @@ -3266,6 +3323,13 @@ dependencies: core-js "^3.8.2" +"@storybook/core-events@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.5.8.tgz#bc405d37d0ed1a6eafa2682fc085b2a7a992233c" + integrity sha512-lzG4Lg65WFYvjs2k/E3CP4+eyPexEGrDyRMO9Pbj9H9x+eosYptauEbT/wXF83bmUWZKLWWVUAZX7hDcxBO8cw== + dependencies: + core-js "^3.8.2" + "@storybook/core-server@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/core-server/-/core-server-6.5.7.tgz#3e849045617a3bc0cfa0091fc3952c150114428e" @@ -3576,6 +3640,15 @@ core-js "^3.8.2" regenerator-runtime "^0.13.7" +"@storybook/router@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/router/-/router-6.5.8.tgz#241e3842bdd174e0eeeb9d1de6adb2975615884d" + integrity sha512-tseNJpZ2ZzVYowjekUMpGJVVRMrwOkttieD9mRbHrhh+2n7b+SoMKnuLi3ow0xeOyPL8ZDng2FgRjQzQHXA5Sw== + dependencies: + "@storybook/client-logger" "6.5.8" + core-js "^3.8.2" + regenerator-runtime "^0.13.7" + "@storybook/semver@^7.3.2": version "7.3.2" resolved "https://registry.yarnpkg.com/@storybook/semver/-/semver-7.3.2.tgz#f3b9c44a1c9a0b933c04e66d0048fcf2fa10dac0" @@ -3648,6 +3721,15 @@ core-js "^3.8.2" regenerator-runtime "^0.13.7" +"@storybook/theming@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-6.5.8.tgz#240a3c83ea53a9c7b1f3a2c47d6324f38ecb8771" + integrity sha512-1VaKHqj38Ls1bJwDpg3+aEOlvVib/DCFkP6WYrP/AQtNAzxiyw5WkaoRlTVJZvCdu5TxjpG4O6/Ai5TI9QftIg== + dependencies: + "@storybook/client-logger" "6.5.8" + core-js "^3.8.2" + regenerator-runtime "^0.13.7" + "@storybook/ui@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-6.5.7.tgz#d4814c88bd1ca4781891611c2c1fbb23e221d95a" From 097c983c49d8ef70be20a8e1bf9e5a2ca430a38d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 14:31:43 +0000 Subject: [PATCH 17/20] :arrow_up: Bump webpack-cli from 4.9.2 to 4.10.0 Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.9.2 to 4.10.0. - [Release notes](https://github.com/webpack/webpack-cli/releases) - [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.9.2...webpack-cli@4.10.0) --- updated-dependencies: - dependency-name: webpack-cli dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 2 +- packages/squiggle-lang/package.json | 2 +- yarn.lock | 40 ++++++++++++++--------------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index e5023e10..9584eb1e 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -54,7 +54,7 @@ "typescript": "^4.7.3", "web-vitals": "^2.1.4", "webpack": "^5.73.0", - "webpack-cli": "^4.9.2", + "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.9.0" }, "scripts": { diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index 7c519cb0..680de2e2 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -64,7 +64,7 @@ "ts-node": "^10.8.1", "typescript": "^4.7.3", "webpack": "^5.73.0", - "webpack-cli": "^4.9.2" + "webpack-cli": "^4.10.0" }, "source": "./src/js/index.ts", "main": "./dist/src/js/index.js", diff --git a/yarn.lock b/yarn.lock index 3b52c384..10b864d0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4864,22 +4864,22 @@ "@webassemblyjs/wast-parser" "1.9.0" "@xtuc/long" "4.2.2" -"@webpack-cli/configtest@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.1.1.tgz#9f53b1b7946a6efc2a749095a4f450e2932e8356" - integrity sha512-1FBc1f9G4P/AxMqIgfZgeOTuRnwZMten8E7zap5zgpPInnCrP8D4Q81+4CWIch8i/Nf7nXjP0v6CjjbHOrXhKg== +"@webpack-cli/configtest@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.2.0.tgz#7b20ce1c12533912c3b217ea68262365fa29a6f5" + integrity sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg== -"@webpack-cli/info@^1.4.1": - version "1.4.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.4.1.tgz#2360ea1710cbbb97ff156a3f0f24556e0fc1ebea" - integrity sha512-PKVGmazEq3oAo46Q63tpMr4HipI3OPfP7LiNOEJg963RMgT0rqheag28NCML0o3GIzA3DmxP1ZIAv9oTX1CUIA== +"@webpack-cli/info@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.5.0.tgz#6c78c13c5874852d6e2dd17f08a41f3fe4c261b1" + integrity sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ== dependencies: envinfo "^7.7.3" -"@webpack-cli/serve@^1.6.1": - version "1.6.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.6.1.tgz#0de2875ac31b46b6c5bb1ae0a7d7f0ba5678dffe" - integrity sha512-gNGTiTrjEVQ0OcVnzsRSqTxaBSr+dmTfm+qJsCDluky8uhdLWep7Gcr62QsAKHTMxjCS/8nEITsmFAhfIx+QSw== +"@webpack-cli/serve@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.7.0.tgz#e1993689ac42d2b16e9194376cfb6753f6254db1" + integrity sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q== "@xobotyi/scrollbar-width@^1.9.5": version "1.9.5" @@ -17897,18 +17897,18 @@ webpack-bundle-analyzer@^4.5.0: sirv "^1.0.7" ws "^7.3.1" -webpack-cli@^4.9.2: - version "4.9.2" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.9.2.tgz#77c1adaea020c3f9e2db8aad8ea78d235c83659d" - integrity sha512-m3/AACnBBzK/kMTcxWHcZFPrw/eQuY4Df1TxvIWfWM2x7mRqBQCqKEd96oCUa9jkapLBaFfRce33eGDb4Pr7YQ== +webpack-cli@^4.10.0: + version "4.10.0" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.10.0.tgz#37c1d69c8d85214c5a65e589378f53aec64dab31" + integrity sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w== dependencies: "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/configtest" "^1.1.1" - "@webpack-cli/info" "^1.4.1" - "@webpack-cli/serve" "^1.6.1" + "@webpack-cli/configtest" "^1.2.0" + "@webpack-cli/info" "^1.5.0" + "@webpack-cli/serve" "^1.7.0" colorette "^2.0.14" commander "^7.0.0" - execa "^5.0.0" + cross-spawn "^7.0.3" fastest-levenshtein "^1.0.12" import-local "^3.0.2" interpret "^2.2.0" From e40d5f5c8ae3c40aeee50cf037574df1243aca5d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 15:35:47 +0000 Subject: [PATCH 18/20] :arrow_up: Bump @storybook/addon-actions from 6.5.7 to 6.5.8 Bumps [@storybook/addon-actions](https://github.com/storybookjs/storybook/tree/HEAD/addons/actions) from 6.5.7 to 6.5.8. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.8/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.8/addons/actions) --- updated-dependencies: - dependency-name: "@storybook/addon-actions" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 6 +- yarn.lock | 180 ++++++++++++++++++++++++++----- 2 files changed, 154 insertions(+), 32 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index e5023e10..be0de752 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -22,9 +22,9 @@ }, "devDependencies": { "@babel/plugin-proposal-private-property-in-object": "^7.17.12", - "@storybook/addon-actions": "^6.5.7", + "@storybook/addon-actions": "^6.5.8", "@storybook/addon-essentials": "^6.5.7", - "@storybook/addon-links": "^6.5.7", + "@storybook/addon-links": "^6.5.8", "@storybook/builder-webpack5": "^6.5.7", "@storybook/manager-webpack5": "^6.5.7", "@storybook/node-logger": "^6.5.6", @@ -54,7 +54,7 @@ "typescript": "^4.7.3", "web-vitals": "^2.1.4", "webpack": "^5.73.0", - "webpack-cli": "^4.9.2", + "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.9.0" }, "scripts": { diff --git a/yarn.lock b/yarn.lock index 3b52c384..6b581233 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2763,7 +2763,7 @@ "@stdlib/types" "^0.0.x" debug "^2.6.9" -"@storybook/addon-actions@6.5.7", "@storybook/addon-actions@^6.5.7": +"@storybook/addon-actions@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/addon-actions/-/addon-actions-6.5.7.tgz#0280a994f42e80ae7e8b71ccf04cd0279cbce01d" integrity sha512-gTkPr2FYX+vySZKEg5Wq7uHPkVUq3hJ7ZKvGls+/xjgaTwfu3iIly53FEFUl8A6kMQ+4gtTC+YRr3cSJgXMbAg== @@ -2788,6 +2788,31 @@ util-deprecate "^1.0.2" uuid-browser "^3.1.0" +"@storybook/addon-actions@^6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/addon-actions/-/addon-actions-6.5.8.tgz#c1f544acc016a4a0d5dcb373535dc991b5737c5f" + integrity sha512-9ciR1iWBTzQNBDlq0iQs9+TV7gng+FbQxW5mHNxNvT9SxY1dt02wCPHZeVE/5la61wBXZs/zpEepZA93VzVBDw== + dependencies: + "@storybook/addons" "6.5.8" + "@storybook/api" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/components" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/theming" "6.5.8" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.21" + polished "^4.2.2" + prop-types "^15.7.2" + react-inspector "^5.1.0" + regenerator-runtime "^0.13.7" + telejson "^6.0.8" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + uuid-browser "^3.1.0" + "@storybook/addon-backgrounds@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/addon-backgrounds/-/addon-backgrounds-6.5.7.tgz#2bd823a94db05bf2b836121adb7e7b49c33b99b2" @@ -2880,16 +2905,16 @@ regenerator-runtime "^0.13.7" ts-dedent "^2.0.0" -"@storybook/addon-links@^6.5.7": - version "6.5.7" - resolved "https://registry.yarnpkg.com/@storybook/addon-links/-/addon-links-6.5.7.tgz#b3a794b19c5c0277c3f20f86915c851f577dc45b" - integrity sha512-kiCzGLlCyhfBjwYfM/xACe5l6s2+8exQNOGoLzNeAhprgD7dzpsZ0ZaEgpF4ay9bG9H9gOeX4jc/TAvVW/v6nw== +"@storybook/addon-links@^6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/addon-links/-/addon-links-6.5.8.tgz#ec4b640bf89dbb653592e6f05968ba771bb10b4a" + integrity sha512-UxzEPnT1PLPsuy3tt+o3UJTbI4Kihec+/yzpzzGKreUnCC8EWTsOhtMQAVVit2t4BMl4vNrxKO0mKSc8saT3Gw== dependencies: - "@storybook/addons" "6.5.7" - "@storybook/client-logger" "6.5.7" - "@storybook/core-events" "6.5.7" + "@storybook/addons" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/router" "6.5.7" + "@storybook/router" "6.5.8" "@types/qs" "^6.9.5" core-js "^3.8.2" global "^4.4.0" @@ -2975,6 +3000,23 @@ global "^4.4.0" regenerator-runtime "^0.13.7" +"@storybook/addons@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-6.5.8.tgz#c529a2989830a09d26308277a3e356228479053d" + integrity sha512-L3LmbsYP9tDHHvpr/yv8YuEkzym7SXp/jZ0km31tpG3EuZmgGu7MXPrZ2ymEw4PkAhQzztgRr23VTfKobGUojA== + dependencies: + "@storybook/api" "6.5.8" + "@storybook/channels" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/router" "6.5.8" + "@storybook/theming" "6.5.8" + "@types/webpack-env" "^1.16.0" + core-js "^3.8.2" + global "^4.4.0" + regenerator-runtime "^0.13.7" + "@storybook/api@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.7.tgz#1a5fc381fd417fd1c8ab6e246af09fdcd20f9df0" @@ -2998,6 +3040,29 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" +"@storybook/api@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.8.tgz#8bd400b8a5b18ec6bff5d35a898593d9c1c630f9" + integrity sha512-/MueV+wLCvy9gFA3ih4g7QYjDmn14i+D2ydonfaEC7R+agFGXxXwJGPKkz3yBNrRpNkBwcbY9mAmv8lE2AqgqQ== + dependencies: + "@storybook/channels" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/router" "6.5.8" + "@storybook/semver" "^7.3.2" + "@storybook/theming" "6.5.8" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.21" + memoizerific "^1.11.3" + regenerator-runtime "^0.13.7" + store2 "^2.12.0" + telejson "^6.0.8" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/builder-webpack4@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/builder-webpack4/-/builder-webpack4-6.5.7.tgz#043ad0625eedb39fcd07035cdb252973d3eb6ef9" @@ -3128,6 +3193,15 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" +"@storybook/channels@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.5.8.tgz#e85ffd2076813b67336b1b9b274c37aa5f1b80e0" + integrity sha512-fNql1lEIvWlI1NiRtwFMWOOvfW6qxgeSP6xoqiAJ0b+QYegEFG9UxJDuEvVHq++S81FulgQ5U+p+5R9XSV19tQ== + dependencies: + core-js "^3.8.2" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/client-api@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-6.5.7.tgz#e5d7a5ca698138f4eba36e14d49138850163f252" @@ -3162,6 +3236,14 @@ core-js "^3.8.2" global "^4.4.0" +"@storybook/client-logger@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.5.8.tgz#551f818c4448ef6e6adf9c3ad256e1ae61e2d75c" + integrity sha512-dH6HSaVuOIMHy1+rpsqcD3SJxVZEEbuEtsNpdUGwLJaIuduhUJJpM2xQfUW0siZDyrgwoa+znll+G0YNUbv7sg== + dependencies: + core-js "^3.8.2" + global "^4.4.0" + "@storybook/components@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.5.7.tgz#28a509c0556f8df919c8c7f7076ca6785b22cb8d" @@ -3177,6 +3259,21 @@ regenerator-runtime "^0.13.7" util-deprecate "^1.0.2" +"@storybook/components@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.5.8.tgz#eb18cfcc4e88b7f4081b20b8a81b92d7ae9eaeac" + integrity sha512-YE+LZ1/GXoqertxodsf+L9ehcohbICRAxgE/iNqc7MZfk95SD3XRSUbxhCpGe8QTIZJpzs1tK4LFZ3Fg5w/+Lg== + dependencies: + "@storybook/client-logger" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/theming" "6.5.8" + "@types/react-syntax-highlighter" "11.0.5" + core-js "^3.8.2" + qs "^6.10.0" + react-syntax-highlighter "^15.4.5" + regenerator-runtime "^0.13.7" + util-deprecate "^1.0.2" + "@storybook/core-client@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/core-client/-/core-client-6.5.7.tgz#556a38330c89adfacf5151cda0b5c32e24499737" @@ -3266,6 +3363,13 @@ dependencies: core-js "^3.8.2" +"@storybook/core-events@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.5.8.tgz#bc405d37d0ed1a6eafa2682fc085b2a7a992233c" + integrity sha512-lzG4Lg65WFYvjs2k/E3CP4+eyPexEGrDyRMO9Pbj9H9x+eosYptauEbT/wXF83bmUWZKLWWVUAZX7hDcxBO8cw== + dependencies: + core-js "^3.8.2" + "@storybook/core-server@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/core-server/-/core-server-6.5.7.tgz#3e849045617a3bc0cfa0091fc3952c150114428e" @@ -3576,6 +3680,15 @@ core-js "^3.8.2" regenerator-runtime "^0.13.7" +"@storybook/router@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/router/-/router-6.5.8.tgz#241e3842bdd174e0eeeb9d1de6adb2975615884d" + integrity sha512-tseNJpZ2ZzVYowjekUMpGJVVRMrwOkttieD9mRbHrhh+2n7b+SoMKnuLi3ow0xeOyPL8ZDng2FgRjQzQHXA5Sw== + dependencies: + "@storybook/client-logger" "6.5.8" + core-js "^3.8.2" + regenerator-runtime "^0.13.7" + "@storybook/semver@^7.3.2": version "7.3.2" resolved "https://registry.yarnpkg.com/@storybook/semver/-/semver-7.3.2.tgz#f3b9c44a1c9a0b933c04e66d0048fcf2fa10dac0" @@ -3648,6 +3761,15 @@ core-js "^3.8.2" regenerator-runtime "^0.13.7" +"@storybook/theming@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-6.5.8.tgz#240a3c83ea53a9c7b1f3a2c47d6324f38ecb8771" + integrity sha512-1VaKHqj38Ls1bJwDpg3+aEOlvVib/DCFkP6WYrP/AQtNAzxiyw5WkaoRlTVJZvCdu5TxjpG4O6/Ai5TI9QftIg== + dependencies: + "@storybook/client-logger" "6.5.8" + core-js "^3.8.2" + regenerator-runtime "^0.13.7" + "@storybook/ui@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-6.5.7.tgz#d4814c88bd1ca4781891611c2c1fbb23e221d95a" @@ -4864,22 +4986,22 @@ "@webassemblyjs/wast-parser" "1.9.0" "@xtuc/long" "4.2.2" -"@webpack-cli/configtest@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.1.1.tgz#9f53b1b7946a6efc2a749095a4f450e2932e8356" - integrity sha512-1FBc1f9G4P/AxMqIgfZgeOTuRnwZMten8E7zap5zgpPInnCrP8D4Q81+4CWIch8i/Nf7nXjP0v6CjjbHOrXhKg== +"@webpack-cli/configtest@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.2.0.tgz#7b20ce1c12533912c3b217ea68262365fa29a6f5" + integrity sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg== -"@webpack-cli/info@^1.4.1": - version "1.4.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.4.1.tgz#2360ea1710cbbb97ff156a3f0f24556e0fc1ebea" - integrity sha512-PKVGmazEq3oAo46Q63tpMr4HipI3OPfP7LiNOEJg963RMgT0rqheag28NCML0o3GIzA3DmxP1ZIAv9oTX1CUIA== +"@webpack-cli/info@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.5.0.tgz#6c78c13c5874852d6e2dd17f08a41f3fe4c261b1" + integrity sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ== dependencies: envinfo "^7.7.3" -"@webpack-cli/serve@^1.6.1": - version "1.6.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.6.1.tgz#0de2875ac31b46b6c5bb1ae0a7d7f0ba5678dffe" - integrity sha512-gNGTiTrjEVQ0OcVnzsRSqTxaBSr+dmTfm+qJsCDluky8uhdLWep7Gcr62QsAKHTMxjCS/8nEITsmFAhfIx+QSw== +"@webpack-cli/serve@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.7.0.tgz#e1993689ac42d2b16e9194376cfb6753f6254db1" + integrity sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q== "@xobotyi/scrollbar-width@^1.9.5": version "1.9.5" @@ -17897,18 +18019,18 @@ webpack-bundle-analyzer@^4.5.0: sirv "^1.0.7" ws "^7.3.1" -webpack-cli@^4.9.2: - version "4.9.2" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.9.2.tgz#77c1adaea020c3f9e2db8aad8ea78d235c83659d" - integrity sha512-m3/AACnBBzK/kMTcxWHcZFPrw/eQuY4Df1TxvIWfWM2x7mRqBQCqKEd96oCUa9jkapLBaFfRce33eGDb4Pr7YQ== +webpack-cli@^4.10.0: + version "4.10.0" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.10.0.tgz#37c1d69c8d85214c5a65e589378f53aec64dab31" + integrity sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w== dependencies: "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/configtest" "^1.1.1" - "@webpack-cli/info" "^1.4.1" - "@webpack-cli/serve" "^1.6.1" + "@webpack-cli/configtest" "^1.2.0" + "@webpack-cli/info" "^1.5.0" + "@webpack-cli/serve" "^1.7.0" colorette "^2.0.14" commander "^7.0.0" - execa "^5.0.0" + cross-spawn "^7.0.3" fastest-levenshtein "^1.0.12" import-local "^3.0.2" interpret "^2.2.0" From a3b8b3bb31be99233a0e75e9f843b057e2284745 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 15:36:12 +0000 Subject: [PATCH 19/20] :arrow_up: Bump @storybook/manager-webpack5 from 6.5.7 to 6.5.8 Bumps [@storybook/manager-webpack5](https://github.com/storybookjs/storybook/tree/HEAD/lib/core) from 6.5.7 to 6.5.8. - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v6.5.8/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v6.5.8/lib/core) --- updated-dependencies: - dependency-name: "@storybook/manager-webpack5" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- packages/components/package.json | 6 +- yarn.lock | 379 +++++++++++++++++++++++++++---- 2 files changed, 343 insertions(+), 42 deletions(-) diff --git a/packages/components/package.json b/packages/components/package.json index e5023e10..049279f9 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -24,9 +24,9 @@ "@babel/plugin-proposal-private-property-in-object": "^7.17.12", "@storybook/addon-actions": "^6.5.7", "@storybook/addon-essentials": "^6.5.7", - "@storybook/addon-links": "^6.5.7", + "@storybook/addon-links": "^6.5.8", "@storybook/builder-webpack5": "^6.5.7", - "@storybook/manager-webpack5": "^6.5.7", + "@storybook/manager-webpack5": "^6.5.8", "@storybook/node-logger": "^6.5.6", "@storybook/preset-create-react-app": "^4.1.2", "@storybook/react": "^6.5.7", @@ -54,7 +54,7 @@ "typescript": "^4.7.3", "web-vitals": "^2.1.4", "webpack": "^5.73.0", - "webpack-cli": "^4.9.2", + "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.9.0" }, "scripts": { diff --git a/yarn.lock b/yarn.lock index 3b52c384..8bb3625d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2880,16 +2880,16 @@ regenerator-runtime "^0.13.7" ts-dedent "^2.0.0" -"@storybook/addon-links@^6.5.7": - version "6.5.7" - resolved "https://registry.yarnpkg.com/@storybook/addon-links/-/addon-links-6.5.7.tgz#b3a794b19c5c0277c3f20f86915c851f577dc45b" - integrity sha512-kiCzGLlCyhfBjwYfM/xACe5l6s2+8exQNOGoLzNeAhprgD7dzpsZ0ZaEgpF4ay9bG9H9gOeX4jc/TAvVW/v6nw== +"@storybook/addon-links@^6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/addon-links/-/addon-links-6.5.8.tgz#ec4b640bf89dbb653592e6f05968ba771bb10b4a" + integrity sha512-UxzEPnT1PLPsuy3tt+o3UJTbI4Kihec+/yzpzzGKreUnCC8EWTsOhtMQAVVit2t4BMl4vNrxKO0mKSc8saT3Gw== dependencies: - "@storybook/addons" "6.5.7" - "@storybook/client-logger" "6.5.7" - "@storybook/core-events" "6.5.7" + "@storybook/addons" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/router" "6.5.7" + "@storybook/router" "6.5.8" "@types/qs" "^6.9.5" core-js "^3.8.2" global "^4.4.0" @@ -2975,6 +2975,23 @@ global "^4.4.0" regenerator-runtime "^0.13.7" +"@storybook/addons@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-6.5.8.tgz#c529a2989830a09d26308277a3e356228479053d" + integrity sha512-L3LmbsYP9tDHHvpr/yv8YuEkzym7SXp/jZ0km31tpG3EuZmgGu7MXPrZ2ymEw4PkAhQzztgRr23VTfKobGUojA== + dependencies: + "@storybook/api" "6.5.8" + "@storybook/channels" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/router" "6.5.8" + "@storybook/theming" "6.5.8" + "@types/webpack-env" "^1.16.0" + core-js "^3.8.2" + global "^4.4.0" + regenerator-runtime "^0.13.7" + "@storybook/api@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.7.tgz#1a5fc381fd417fd1c8ab6e246af09fdcd20f9df0" @@ -2998,6 +3015,29 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" +"@storybook/api@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.8.tgz#8bd400b8a5b18ec6bff5d35a898593d9c1c630f9" + integrity sha512-/MueV+wLCvy9gFA3ih4g7QYjDmn14i+D2ydonfaEC7R+agFGXxXwJGPKkz3yBNrRpNkBwcbY9mAmv8lE2AqgqQ== + dependencies: + "@storybook/channels" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/router" "6.5.8" + "@storybook/semver" "^7.3.2" + "@storybook/theming" "6.5.8" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.21" + memoizerific "^1.11.3" + regenerator-runtime "^0.13.7" + store2 "^2.12.0" + telejson "^6.0.8" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/builder-webpack4@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/builder-webpack4/-/builder-webpack4-6.5.7.tgz#043ad0625eedb39fcd07035cdb252973d3eb6ef9" @@ -3108,6 +3148,19 @@ qs "^6.10.0" telejson "^6.0.8" +"@storybook/channel-postmessage@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/channel-postmessage/-/channel-postmessage-6.5.8.tgz#989af9a55eba391b64487640f6b5b0cfd1fde2f9" + integrity sha512-6IkIKk+UMYKk05vN8gWHvvOV/EZNXpQG/5gesGDALjkCyvRmcktHak1a9tHpoihZ3L7/gDwXOZraCZmuy8vBcQ== + dependencies: + "@storybook/channels" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + core-js "^3.8.2" + global "^4.4.0" + qs "^6.10.0" + telejson "^6.0.8" + "@storybook/channel-websocket@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/channel-websocket/-/channel-websocket-6.5.7.tgz#69e274319a995d1bd01b3783586cdefcb56277dc" @@ -3119,6 +3172,17 @@ global "^4.4.0" telejson "^6.0.8" +"@storybook/channel-websocket@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/channel-websocket/-/channel-websocket-6.5.8.tgz#722743619f86ebc9325bbff026acf6eba13b21ca" + integrity sha512-lAtvgO0FWsyS3u7uFbsGIYp2aSWJfWU/LOtc3x1K5c84JJAd9fncYkyZMwP1gMbdNgYxJoxe8HXtVtfeNegPuQ== + dependencies: + "@storybook/channels" "6.5.8" + "@storybook/client-logger" "6.5.8" + core-js "^3.8.2" + global "^4.4.0" + telejson "^6.0.8" + "@storybook/channels@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.5.7.tgz#765b02e949f58c4181998c676b155f5c1914bec1" @@ -3128,6 +3192,15 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" +"@storybook/channels@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.5.8.tgz#e85ffd2076813b67336b1b9b274c37aa5f1b80e0" + integrity sha512-fNql1lEIvWlI1NiRtwFMWOOvfW6qxgeSP6xoqiAJ0b+QYegEFG9UxJDuEvVHq++S81FulgQ5U+p+5R9XSV19tQ== + dependencies: + core-js "^3.8.2" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/client-api@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-6.5.7.tgz#e5d7a5ca698138f4eba36e14d49138850163f252" @@ -3154,6 +3227,32 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" +"@storybook/client-api@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-6.5.8.tgz#cf1b3d4a71a3a156636a9b6b51acc4239b259d86" + integrity sha512-mdU+qQ4+T2OUbEnl+3MWRKxEPju/EOIUg66hMgmif8c5u7YFYBFulUMUYLICMjll8Jlu+37+g+qO3K2eEz6CEw== + dependencies: + "@storybook/addons" "6.5.8" + "@storybook/channel-postmessage" "6.5.8" + "@storybook/channels" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/store" "6.5.8" + "@types/qs" "^6.9.5" + "@types/webpack-env" "^1.16.0" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.21" + memoizerific "^1.11.3" + qs "^6.10.0" + regenerator-runtime "^0.13.7" + store2 "^2.12.0" + synchronous-promise "^2.0.15" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/client-logger@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.5.7.tgz#97a607b1d09d32a31091fe286510cf5d3995d2bf" @@ -3162,6 +3261,14 @@ core-js "^3.8.2" global "^4.4.0" +"@storybook/client-logger@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.5.8.tgz#551f818c4448ef6e6adf9c3ad256e1ae61e2d75c" + integrity sha512-dH6HSaVuOIMHy1+rpsqcD3SJxVZEEbuEtsNpdUGwLJaIuduhUJJpM2xQfUW0siZDyrgwoa+znll+G0YNUbv7sg== + dependencies: + core-js "^3.8.2" + global "^4.4.0" + "@storybook/components@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.5.7.tgz#28a509c0556f8df919c8c7f7076ca6785b22cb8d" @@ -3177,6 +3284,21 @@ regenerator-runtime "^0.13.7" util-deprecate "^1.0.2" +"@storybook/components@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.5.8.tgz#eb18cfcc4e88b7f4081b20b8a81b92d7ae9eaeac" + integrity sha512-YE+LZ1/GXoqertxodsf+L9ehcohbICRAxgE/iNqc7MZfk95SD3XRSUbxhCpGe8QTIZJpzs1tK4LFZ3Fg5w/+Lg== + dependencies: + "@storybook/client-logger" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/theming" "6.5.8" + "@types/react-syntax-highlighter" "11.0.5" + core-js "^3.8.2" + qs "^6.10.0" + react-syntax-highlighter "^15.4.5" + regenerator-runtime "^0.13.7" + util-deprecate "^1.0.2" + "@storybook/core-client@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/core-client/-/core-client-6.5.7.tgz#556a38330c89adfacf5151cda0b5c32e24499737" @@ -3203,6 +3325,32 @@ unfetch "^4.2.0" util-deprecate "^1.0.2" +"@storybook/core-client@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/core-client/-/core-client-6.5.8.tgz#4be4ce024a74b51c0650d346f1f3a11a0f921952" + integrity sha512-8x8qKQ2clvpfDcoWrNBmQ8Xt9z/i32TFIBp4PEZMcbB7eqo517nzfllLiXDipiJgO7BGxKtY5CRHQ9pAU9G27A== + dependencies: + "@storybook/addons" "6.5.8" + "@storybook/channel-postmessage" "6.5.8" + "@storybook/channel-websocket" "6.5.8" + "@storybook/client-api" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/preview-web" "6.5.8" + "@storybook/store" "6.5.8" + "@storybook/ui" "6.5.8" + airbnb-js-shims "^2.2.1" + ansi-to-html "^0.6.11" + core-js "^3.8.2" + global "^4.4.0" + lodash "^4.17.21" + qs "^6.10.0" + regenerator-runtime "^0.13.7" + ts-dedent "^2.0.0" + unfetch "^4.2.0" + util-deprecate "^1.0.2" + "@storybook/core-common@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/core-common/-/core-common-6.5.7.tgz#69519d02b48c719fba734b38bb6a4419abc77a4b" @@ -3259,6 +3407,62 @@ util-deprecate "^1.0.2" webpack "4" +"@storybook/core-common@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/core-common/-/core-common-6.5.8.tgz#6972c7109477914f9ed72bedbe3769cec0eb8c56" + integrity sha512-ELGKLMx1d0oEA2LT+fsmo85X2RNE1EO+It7B1bw//g7jyf1hmZ7t3lXMZUCqt7eml1qy1N72LDkfmmU+H9H6ww== + dependencies: + "@babel/core" "^7.12.10" + "@babel/plugin-proposal-class-properties" "^7.12.1" + "@babel/plugin-proposal-decorators" "^7.12.12" + "@babel/plugin-proposal-export-default-from" "^7.12.1" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.12.1" + "@babel/plugin-proposal-object-rest-spread" "^7.12.1" + "@babel/plugin-proposal-optional-chaining" "^7.12.7" + "@babel/plugin-proposal-private-methods" "^7.12.1" + "@babel/plugin-proposal-private-property-in-object" "^7.12.1" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" + "@babel/plugin-transform-arrow-functions" "^7.12.1" + "@babel/plugin-transform-block-scoping" "^7.12.12" + "@babel/plugin-transform-classes" "^7.12.1" + "@babel/plugin-transform-destructuring" "^7.12.1" + "@babel/plugin-transform-for-of" "^7.12.1" + "@babel/plugin-transform-parameters" "^7.12.1" + "@babel/plugin-transform-shorthand-properties" "^7.12.1" + "@babel/plugin-transform-spread" "^7.12.1" + "@babel/preset-env" "^7.12.11" + "@babel/preset-react" "^7.12.10" + "@babel/preset-typescript" "^7.12.7" + "@babel/register" "^7.12.1" + "@storybook/node-logger" "6.5.8" + "@storybook/semver" "^7.3.2" + "@types/node" "^14.0.10 || ^16.0.0" + "@types/pretty-hrtime" "^1.0.0" + babel-loader "^8.0.0" + babel-plugin-macros "^3.0.1" + babel-plugin-polyfill-corejs3 "^0.1.0" + chalk "^4.1.0" + core-js "^3.8.2" + express "^4.17.1" + file-system-cache "^1.0.5" + find-up "^5.0.0" + fork-ts-checker-webpack-plugin "^6.0.4" + fs-extra "^9.0.1" + glob "^7.1.6" + handlebars "^4.7.7" + interpret "^2.2.0" + json5 "^2.1.3" + lazy-universal-dotenv "^3.0.1" + picomatch "^2.3.0" + pkg-dir "^5.0.0" + pretty-hrtime "^1.0.3" + resolve-from "^5.0.0" + slash "^3.0.0" + telejson "^6.0.8" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + webpack "4" + "@storybook/core-events@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.5.7.tgz#a533f3a57e495a1660c82c5d6164ca464bf4a2b2" @@ -3266,6 +3470,13 @@ dependencies: core-js "^3.8.2" +"@storybook/core-events@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.5.8.tgz#bc405d37d0ed1a6eafa2682fc085b2a7a992233c" + integrity sha512-lzG4Lg65WFYvjs2k/E3CP4+eyPexEGrDyRMO9Pbj9H9x+eosYptauEbT/wXF83bmUWZKLWWVUAZX7hDcxBO8cw== + dependencies: + core-js "^3.8.2" + "@storybook/core-server@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/core-server/-/core-server-6.5.7.tgz#3e849045617a3bc0cfa0091fc3952c150114428e" @@ -3406,20 +3617,20 @@ webpack-dev-middleware "^3.7.3" webpack-virtual-modules "^0.2.2" -"@storybook/manager-webpack5@^6.5.7": - version "6.5.7" - resolved "https://registry.yarnpkg.com/@storybook/manager-webpack5/-/manager-webpack5-6.5.7.tgz#a7446c86d96bb4b91e5dc554d21da8102795a11f" - integrity sha512-4TZKe71noCRui8sUxSuSqO6zMnCxCLn7dE1dOlCr/UvyZbCaGWACO5olUDQrT+n1glZL8i9L998JGQroksucNw== +"@storybook/manager-webpack5@^6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/manager-webpack5/-/manager-webpack5-6.5.8.tgz#36e97096506073c837716897495fffe4a616fe83" + integrity sha512-foW/ZvTqGZAl4TfcfGKdS3RlaBDDAgEjUCbCaVShlZRshZ8tzWBVu3JQFqbPVGslH89T5qp9DUYoN/SJqTUpcg== dependencies: "@babel/core" "^7.12.10" "@babel/plugin-transform-template-literals" "^7.12.1" "@babel/preset-react" "^7.12.10" - "@storybook/addons" "6.5.7" - "@storybook/core-client" "6.5.7" - "@storybook/core-common" "6.5.7" - "@storybook/node-logger" "6.5.7" - "@storybook/theming" "6.5.7" - "@storybook/ui" "6.5.7" + "@storybook/addons" "6.5.8" + "@storybook/core-client" "6.5.8" + "@storybook/core-common" "6.5.8" + "@storybook/node-logger" "6.5.8" + "@storybook/theming" "6.5.8" + "@storybook/ui" "6.5.8" "@types/node" "^14.0.10 || ^16.0.0" babel-loader "^8.0.0" case-sensitive-paths-webpack-plugin "^2.3.0" @@ -3461,7 +3672,7 @@ prettier ">=2.2.1 <=2.3.0" ts-dedent "^2.0.0" -"@storybook/node-logger@6.5.7", "@storybook/node-logger@^6.5.6": +"@storybook/node-logger@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-6.5.7.tgz#a31d91be3cd9d9f033d340b1dc2b8e1c0de61cb6" integrity sha512-OrHu5p2E5i7P2v2hQAOtZw6Od1e2nrP6L7w5SxUPgccUnKUD9dRX5Y8qbAcPZO3XCkMLjpjAbC1xBXG0eFkn9g== @@ -3472,6 +3683,17 @@ npmlog "^5.0.1" pretty-hrtime "^1.0.3" +"@storybook/node-logger@6.5.8", "@storybook/node-logger@^6.5.6": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-6.5.8.tgz#d1244c846da5a296a7432444f8682f77853fb81e" + integrity sha512-BHdkSipgjnfsh4FRYbV2R0npM5gVx9JLRsDQ0KiTolRpN4SU98kT/6885zb9jZg6I0EY+UG9Qdr3fvL9VLpY1g== + dependencies: + "@types/npmlog" "^4.1.2" + chalk "^4.1.0" + core-js "^3.8.2" + npmlog "^5.0.1" + pretty-hrtime "^1.0.3" + "@storybook/postinstall@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/postinstall/-/postinstall-6.5.7.tgz#5bca298bfdfe37dff9d42fa7588d3bdce3e1aa85" @@ -3513,6 +3735,28 @@ unfetch "^4.2.0" util-deprecate "^1.0.2" +"@storybook/preview-web@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/preview-web/-/preview-web-6.5.8.tgz#b1c86d56e99032c02ba47bab628c36d76a0385b6" + integrity sha512-jEEAgvTVZfFA0B20mRJfLW6dPA5mG5PxUJtjMx6wH4Yw4+i3Sld/U63hTRt7ktpKdrcu4lX9E+PuaRLPq7S2kg== + dependencies: + "@storybook/addons" "6.5.8" + "@storybook/channel-postmessage" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/store" "6.5.8" + ansi-to-html "^0.6.11" + core-js "^3.8.2" + global "^4.4.0" + lodash "^4.17.21" + qs "^6.10.0" + regenerator-runtime "^0.13.7" + synchronous-promise "^2.0.15" + ts-dedent "^2.0.0" + unfetch "^4.2.0" + util-deprecate "^1.0.2" + "@storybook/react-docgen-typescript-plugin@1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0", "@storybook/react-docgen-typescript-plugin@canary": version "1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0" resolved "https://registry.yarnpkg.com/@storybook/react-docgen-typescript-plugin/-/react-docgen-typescript-plugin-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0.tgz#3103532ff494fb7dc3cf835f10740ecf6a26c0f9" @@ -3576,6 +3820,15 @@ core-js "^3.8.2" regenerator-runtime "^0.13.7" +"@storybook/router@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/router/-/router-6.5.8.tgz#241e3842bdd174e0eeeb9d1de6adb2975615884d" + integrity sha512-tseNJpZ2ZzVYowjekUMpGJVVRMrwOkttieD9mRbHrhh+2n7b+SoMKnuLi3ow0xeOyPL8ZDng2FgRjQzQHXA5Sw== + dependencies: + "@storybook/client-logger" "6.5.8" + core-js "^3.8.2" + regenerator-runtime "^0.13.7" + "@storybook/semver@^7.3.2": version "7.3.2" resolved "https://registry.yarnpkg.com/@storybook/semver/-/semver-7.3.2.tgz#f3b9c44a1c9a0b933c04e66d0048fcf2fa10dac0" @@ -3621,6 +3874,27 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" +"@storybook/store@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/store/-/store-6.5.8.tgz#528bf9a2decf5121045fb0a19b8caf795b4a5647" + integrity sha512-5rhGjN/O0oLebRv947B0vgapq48qBBBYYOgq4krRUYU2ecS6LUgtAHR/kTa324o9aBO8cnIXHH78jZcSvMiJlQ== + dependencies: + "@storybook/addons" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.21" + memoizerific "^1.11.3" + regenerator-runtime "^0.13.7" + slash "^3.0.0" + stable "^0.1.8" + synchronous-promise "^2.0.15" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/telemetry@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/telemetry/-/telemetry-6.5.7.tgz#744050ec84b8d8effeab448b9b2e190951a2e070" @@ -3648,6 +3922,15 @@ core-js "^3.8.2" regenerator-runtime "^0.13.7" +"@storybook/theming@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-6.5.8.tgz#240a3c83ea53a9c7b1f3a2c47d6324f38ecb8771" + integrity sha512-1VaKHqj38Ls1bJwDpg3+aEOlvVib/DCFkP6WYrP/AQtNAzxiyw5WkaoRlTVJZvCdu5TxjpG4O6/Ai5TI9QftIg== + dependencies: + "@storybook/client-logger" "6.5.8" + core-js "^3.8.2" + regenerator-runtime "^0.13.7" + "@storybook/ui@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-6.5.7.tgz#d4814c88bd1ca4781891611c2c1fbb23e221d95a" @@ -3666,6 +3949,24 @@ regenerator-runtime "^0.13.7" resolve-from "^5.0.0" +"@storybook/ui@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-6.5.8.tgz#acd8dadd221c68f65c4963c4ab86b4a757860591" + integrity sha512-rL09kxgY9pCVbxr/VUK4b5FL5VbALfciZR+50sNT1EcTDb9k0OPeqx7a4Ptc+KNkgyPdSTxUGvhzVqH5PYrhZQ== + dependencies: + "@storybook/addons" "6.5.8" + "@storybook/api" "6.5.8" + "@storybook/channels" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/components" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/router" "6.5.8" + "@storybook/semver" "^7.3.2" + "@storybook/theming" "6.5.8" + core-js "^3.8.2" + regenerator-runtime "^0.13.7" + resolve-from "^5.0.0" + "@surma/rollup-plugin-off-main-thread@^2.2.3": version "2.2.3" resolved "https://registry.yarnpkg.com/@surma/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-2.2.3.tgz#ee34985952ca21558ab0d952f00298ad2190c053" @@ -4864,22 +5165,22 @@ "@webassemblyjs/wast-parser" "1.9.0" "@xtuc/long" "4.2.2" -"@webpack-cli/configtest@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.1.1.tgz#9f53b1b7946a6efc2a749095a4f450e2932e8356" - integrity sha512-1FBc1f9G4P/AxMqIgfZgeOTuRnwZMten8E7zap5zgpPInnCrP8D4Q81+4CWIch8i/Nf7nXjP0v6CjjbHOrXhKg== +"@webpack-cli/configtest@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.2.0.tgz#7b20ce1c12533912c3b217ea68262365fa29a6f5" + integrity sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg== -"@webpack-cli/info@^1.4.1": - version "1.4.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.4.1.tgz#2360ea1710cbbb97ff156a3f0f24556e0fc1ebea" - integrity sha512-PKVGmazEq3oAo46Q63tpMr4HipI3OPfP7LiNOEJg963RMgT0rqheag28NCML0o3GIzA3DmxP1ZIAv9oTX1CUIA== +"@webpack-cli/info@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.5.0.tgz#6c78c13c5874852d6e2dd17f08a41f3fe4c261b1" + integrity sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ== dependencies: envinfo "^7.7.3" -"@webpack-cli/serve@^1.6.1": - version "1.6.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.6.1.tgz#0de2875ac31b46b6c5bb1ae0a7d7f0ba5678dffe" - integrity sha512-gNGTiTrjEVQ0OcVnzsRSqTxaBSr+dmTfm+qJsCDluky8uhdLWep7Gcr62QsAKHTMxjCS/8nEITsmFAhfIx+QSw== +"@webpack-cli/serve@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.7.0.tgz#e1993689ac42d2b16e9194376cfb6753f6254db1" + integrity sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q== "@xobotyi/scrollbar-width@^1.9.5": version "1.9.5" @@ -17897,18 +18198,18 @@ webpack-bundle-analyzer@^4.5.0: sirv "^1.0.7" ws "^7.3.1" -webpack-cli@^4.9.2: - version "4.9.2" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.9.2.tgz#77c1adaea020c3f9e2db8aad8ea78d235c83659d" - integrity sha512-m3/AACnBBzK/kMTcxWHcZFPrw/eQuY4Df1TxvIWfWM2x7mRqBQCqKEd96oCUa9jkapLBaFfRce33eGDb4Pr7YQ== +webpack-cli@^4.10.0: + version "4.10.0" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.10.0.tgz#37c1d69c8d85214c5a65e589378f53aec64dab31" + integrity sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w== dependencies: "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/configtest" "^1.1.1" - "@webpack-cli/info" "^1.4.1" - "@webpack-cli/serve" "^1.6.1" + "@webpack-cli/configtest" "^1.2.0" + "@webpack-cli/info" "^1.5.0" + "@webpack-cli/serve" "^1.7.0" colorette "^2.0.14" commander "^7.0.0" - execa "^5.0.0" + cross-spawn "^7.0.3" fastest-levenshtein "^1.0.12" import-local "^3.0.2" interpret "^2.2.0" From 0030873bc523b1cc4e9458a4a0235367d90c836d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 15:39:41 +0000 Subject: [PATCH 20/20] :arrow_up: Bump reanalyze from 2.22.0 to 2.23.0 Bumps [reanalyze](https://github.com/cristianoc/reanalyze) from 2.22.0 to 2.23.0. - [Release notes](https://github.com/cristianoc/reanalyze/releases) - [Changelog](https://github.com/rescript-association/reanalyze/blob/master/Changes.md) - [Commits](https://github.com/cristianoc/reanalyze/compare/v2.22.0...v2.23.0) --- updated-dependencies: - dependency-name: reanalyze dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- packages/squiggle-lang/package.json | 4 +- yarn.lock | 146 ++++++++++++++++++++++------ 2 files changed, 116 insertions(+), 34 deletions(-) diff --git a/packages/squiggle-lang/package.json b/packages/squiggle-lang/package.json index 7c519cb0..abc9f239 100644 --- a/packages/squiggle-lang/package.json +++ b/packages/squiggle-lang/package.json @@ -57,14 +57,14 @@ "moduleserve": "^0.9.1", "nyc": "^15.1.0", "peggy": "^2.0.1", - "reanalyze": "^2.22.0", + "reanalyze": "^2.23.0", "rescript-fast-check": "^1.1.1", "ts-jest": "^27.1.4", "ts-loader": "^9.3.0", "ts-node": "^10.8.1", "typescript": "^4.7.3", "webpack": "^5.73.0", - "webpack-cli": "^4.9.2" + "webpack-cli": "^4.10.0" }, "source": "./src/js/index.ts", "main": "./dist/src/js/index.js", diff --git a/yarn.lock b/yarn.lock index 3b52c384..e092507c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2880,16 +2880,16 @@ regenerator-runtime "^0.13.7" ts-dedent "^2.0.0" -"@storybook/addon-links@^6.5.7": - version "6.5.7" - resolved "https://registry.yarnpkg.com/@storybook/addon-links/-/addon-links-6.5.7.tgz#b3a794b19c5c0277c3f20f86915c851f577dc45b" - integrity sha512-kiCzGLlCyhfBjwYfM/xACe5l6s2+8exQNOGoLzNeAhprgD7dzpsZ0ZaEgpF4ay9bG9H9gOeX4jc/TAvVW/v6nw== +"@storybook/addon-links@^6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/addon-links/-/addon-links-6.5.8.tgz#ec4b640bf89dbb653592e6f05968ba771bb10b4a" + integrity sha512-UxzEPnT1PLPsuy3tt+o3UJTbI4Kihec+/yzpzzGKreUnCC8EWTsOhtMQAVVit2t4BMl4vNrxKO0mKSc8saT3Gw== dependencies: - "@storybook/addons" "6.5.7" - "@storybook/client-logger" "6.5.7" - "@storybook/core-events" "6.5.7" + "@storybook/addons" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" "@storybook/csf" "0.0.2--canary.4566f4d.1" - "@storybook/router" "6.5.7" + "@storybook/router" "6.5.8" "@types/qs" "^6.9.5" core-js "^3.8.2" global "^4.4.0" @@ -2975,6 +2975,23 @@ global "^4.4.0" regenerator-runtime "^0.13.7" +"@storybook/addons@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/addons/-/addons-6.5.8.tgz#c529a2989830a09d26308277a3e356228479053d" + integrity sha512-L3LmbsYP9tDHHvpr/yv8YuEkzym7SXp/jZ0km31tpG3EuZmgGu7MXPrZ2ymEw4PkAhQzztgRr23VTfKobGUojA== + dependencies: + "@storybook/api" "6.5.8" + "@storybook/channels" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/router" "6.5.8" + "@storybook/theming" "6.5.8" + "@types/webpack-env" "^1.16.0" + core-js "^3.8.2" + global "^4.4.0" + regenerator-runtime "^0.13.7" + "@storybook/api@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.7.tgz#1a5fc381fd417fd1c8ab6e246af09fdcd20f9df0" @@ -2998,6 +3015,29 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" +"@storybook/api@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/api/-/api-6.5.8.tgz#8bd400b8a5b18ec6bff5d35a898593d9c1c630f9" + integrity sha512-/MueV+wLCvy9gFA3ih4g7QYjDmn14i+D2ydonfaEC7R+agFGXxXwJGPKkz3yBNrRpNkBwcbY9mAmv8lE2AqgqQ== + dependencies: + "@storybook/channels" "6.5.8" + "@storybook/client-logger" "6.5.8" + "@storybook/core-events" "6.5.8" + "@storybook/csf" "0.0.2--canary.4566f4d.1" + "@storybook/router" "6.5.8" + "@storybook/semver" "^7.3.2" + "@storybook/theming" "6.5.8" + core-js "^3.8.2" + fast-deep-equal "^3.1.3" + global "^4.4.0" + lodash "^4.17.21" + memoizerific "^1.11.3" + regenerator-runtime "^0.13.7" + store2 "^2.12.0" + telejson "^6.0.8" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/builder-webpack4@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/builder-webpack4/-/builder-webpack4-6.5.7.tgz#043ad0625eedb39fcd07035cdb252973d3eb6ef9" @@ -3128,6 +3168,15 @@ ts-dedent "^2.0.0" util-deprecate "^1.0.2" +"@storybook/channels@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/channels/-/channels-6.5.8.tgz#e85ffd2076813b67336b1b9b274c37aa5f1b80e0" + integrity sha512-fNql1lEIvWlI1NiRtwFMWOOvfW6qxgeSP6xoqiAJ0b+QYegEFG9UxJDuEvVHq++S81FulgQ5U+p+5R9XSV19tQ== + dependencies: + core-js "^3.8.2" + ts-dedent "^2.0.0" + util-deprecate "^1.0.2" + "@storybook/client-api@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-6.5.7.tgz#e5d7a5ca698138f4eba36e14d49138850163f252" @@ -3162,6 +3211,14 @@ core-js "^3.8.2" global "^4.4.0" +"@storybook/client-logger@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.5.8.tgz#551f818c4448ef6e6adf9c3ad256e1ae61e2d75c" + integrity sha512-dH6HSaVuOIMHy1+rpsqcD3SJxVZEEbuEtsNpdUGwLJaIuduhUJJpM2xQfUW0siZDyrgwoa+znll+G0YNUbv7sg== + dependencies: + core-js "^3.8.2" + global "^4.4.0" + "@storybook/components@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/components/-/components-6.5.7.tgz#28a509c0556f8df919c8c7f7076ca6785b22cb8d" @@ -3266,6 +3323,13 @@ dependencies: core-js "^3.8.2" +"@storybook/core-events@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/core-events/-/core-events-6.5.8.tgz#bc405d37d0ed1a6eafa2682fc085b2a7a992233c" + integrity sha512-lzG4Lg65WFYvjs2k/E3CP4+eyPexEGrDyRMO9Pbj9H9x+eosYptauEbT/wXF83bmUWZKLWWVUAZX7hDcxBO8cw== + dependencies: + core-js "^3.8.2" + "@storybook/core-server@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/core-server/-/core-server-6.5.7.tgz#3e849045617a3bc0cfa0091fc3952c150114428e" @@ -3576,6 +3640,15 @@ core-js "^3.8.2" regenerator-runtime "^0.13.7" +"@storybook/router@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/router/-/router-6.5.8.tgz#241e3842bdd174e0eeeb9d1de6adb2975615884d" + integrity sha512-tseNJpZ2ZzVYowjekUMpGJVVRMrwOkttieD9mRbHrhh+2n7b+SoMKnuLi3ow0xeOyPL8ZDng2FgRjQzQHXA5Sw== + dependencies: + "@storybook/client-logger" "6.5.8" + core-js "^3.8.2" + regenerator-runtime "^0.13.7" + "@storybook/semver@^7.3.2": version "7.3.2" resolved "https://registry.yarnpkg.com/@storybook/semver/-/semver-7.3.2.tgz#f3b9c44a1c9a0b933c04e66d0048fcf2fa10dac0" @@ -3648,6 +3721,15 @@ core-js "^3.8.2" regenerator-runtime "^0.13.7" +"@storybook/theming@6.5.8": + version "6.5.8" + resolved "https://registry.yarnpkg.com/@storybook/theming/-/theming-6.5.8.tgz#240a3c83ea53a9c7b1f3a2c47d6324f38ecb8771" + integrity sha512-1VaKHqj38Ls1bJwDpg3+aEOlvVib/DCFkP6WYrP/AQtNAzxiyw5WkaoRlTVJZvCdu5TxjpG4O6/Ai5TI9QftIg== + dependencies: + "@storybook/client-logger" "6.5.8" + core-js "^3.8.2" + regenerator-runtime "^0.13.7" + "@storybook/ui@6.5.7": version "6.5.7" resolved "https://registry.yarnpkg.com/@storybook/ui/-/ui-6.5.7.tgz#d4814c88bd1ca4781891611c2c1fbb23e221d95a" @@ -4864,22 +4946,22 @@ "@webassemblyjs/wast-parser" "1.9.0" "@xtuc/long" "4.2.2" -"@webpack-cli/configtest@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.1.1.tgz#9f53b1b7946a6efc2a749095a4f450e2932e8356" - integrity sha512-1FBc1f9G4P/AxMqIgfZgeOTuRnwZMten8E7zap5zgpPInnCrP8D4Q81+4CWIch8i/Nf7nXjP0v6CjjbHOrXhKg== +"@webpack-cli/configtest@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.2.0.tgz#7b20ce1c12533912c3b217ea68262365fa29a6f5" + integrity sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg== -"@webpack-cli/info@^1.4.1": - version "1.4.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.4.1.tgz#2360ea1710cbbb97ff156a3f0f24556e0fc1ebea" - integrity sha512-PKVGmazEq3oAo46Q63tpMr4HipI3OPfP7LiNOEJg963RMgT0rqheag28NCML0o3GIzA3DmxP1ZIAv9oTX1CUIA== +"@webpack-cli/info@^1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.5.0.tgz#6c78c13c5874852d6e2dd17f08a41f3fe4c261b1" + integrity sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ== dependencies: envinfo "^7.7.3" -"@webpack-cli/serve@^1.6.1": - version "1.6.1" - resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.6.1.tgz#0de2875ac31b46b6c5bb1ae0a7d7f0ba5678dffe" - integrity sha512-gNGTiTrjEVQ0OcVnzsRSqTxaBSr+dmTfm+qJsCDluky8uhdLWep7Gcr62QsAKHTMxjCS/8nEITsmFAhfIx+QSw== +"@webpack-cli/serve@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.7.0.tgz#e1993689ac42d2b16e9194376cfb6753f6254db1" + integrity sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q== "@xobotyi/scrollbar-width@^1.9.5": version "1.9.5" @@ -14779,10 +14861,10 @@ reading-time@^1.5.0: resolved "https://registry.yarnpkg.com/reading-time/-/reading-time-1.5.0.tgz#d2a7f1b6057cb2e169beaf87113cc3411b5bc5bb" integrity sha512-onYyVhBNr4CmAxFsKS7bz+uTLRakypIe4R+5A824vBSkQy/hB3fZepoVEf8OVAxzLvK+H/jm9TzpI3ETSm64Kg== -reanalyze@^2.22.0: - version "2.22.0" - resolved "https://registry.yarnpkg.com/reanalyze/-/reanalyze-2.22.0.tgz#068cfb354b6e9aa95ceb8dbb04329a67b4a90494" - integrity sha512-VNwTXBsyuUbCkmcb2GkYYjQxv3NQW4CombkNd+n5E+YWNqF5LLFi1N5bETR09C2hbuOE1fM6RTJKgbijZX7jyA== +reanalyze@^2.23.0: + version "2.23.0" + resolved "https://registry.yarnpkg.com/reanalyze/-/reanalyze-2.23.0.tgz#0e2a3109518ccad0ba04366ec1811db17fa07b7e" + integrity sha512-5pkH13pX1PrZFkIfmZUjKtYCqzFY2jTaEjBsqyR9SM3HLexAtkHTa4vLHTwuYk167KuO1uwWyEppo8NJIjfkOw== rechoir@^0.6.2: version "0.6.2" @@ -17897,18 +17979,18 @@ webpack-bundle-analyzer@^4.5.0: sirv "^1.0.7" ws "^7.3.1" -webpack-cli@^4.9.2: - version "4.9.2" - resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.9.2.tgz#77c1adaea020c3f9e2db8aad8ea78d235c83659d" - integrity sha512-m3/AACnBBzK/kMTcxWHcZFPrw/eQuY4Df1TxvIWfWM2x7mRqBQCqKEd96oCUa9jkapLBaFfRce33eGDb4Pr7YQ== +webpack-cli@^4.10.0: + version "4.10.0" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.10.0.tgz#37c1d69c8d85214c5a65e589378f53aec64dab31" + integrity sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w== dependencies: "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/configtest" "^1.1.1" - "@webpack-cli/info" "^1.4.1" - "@webpack-cli/serve" "^1.6.1" + "@webpack-cli/configtest" "^1.2.0" + "@webpack-cli/info" "^1.5.0" + "@webpack-cli/serve" "^1.7.0" colorette "^2.0.14" commander "^7.0.0" - execa "^5.0.0" + cross-spawn "^7.0.3" fastest-levenshtein "^1.0.12" import-local "^3.0.2" interpret "^2.2.0"