Squiggle logoSquiggle

v0.9.0

0.9.0

Published Dec 28, 2023

@quri/squiggle-lang

Tags and decorators

Squiggle now supports tags (Tag.* functions) and decorators (@decoratorName) that can be used to affect how the value is displayed. (#2572 and others).

Tags can be attached to any value, and decorators can be attached to any variable or function definition.

Decorators are proxied to Tag functions, e.g. @name("X var") x = 5 is the same as x = 5 -> Tag.name("X var").

Builtin tags: @name, @description, @format, @showAs, @hide.

  • Tag percentage values with percentage format, so that they're rendered as percentages in viewer (#2759)

  • Removed title attribute from Table.make(); you can use @name and @description tags instead (#2718)

Dates and Durations improvements (#2572).

Added date domains, f(x: [Date(1980), Date(2050)]), that's used in function plots for the x axis.

You can now type Date(2023) to represent Jan 1 2023.

Standard library

  • Alias Module.make() methods to Module() (#2681)
    Examples: List.make() -> List(), Dist.make() -> Dist(), etc.

  • Added Calculator(fn) shorthand (#2660)
    It also works for functions with n>0 params (#2694)

  • Added List.sortBy, List.maxBy, List.minBy, Dict.has, Dict.size, Dict.delete (#2551)

  • Added definitions to Number.min and Number.max that support two number params (#2551)

  • Breaking: Change Number.rangeDomain({min, max}) to be rangeDomain(min, max) (#2692)

  • Breaking: Plot.scatter now only accepts sampleset distributions. (#2655)

  • Added Dist.median, Number.quantile, Number.median (#2577)

  • Added data-first definitions for Plot.dist, Plot.dists, Plot.numericFn, Plot.distFn, Table.make, Calculator.make. Deprecate old versions. (#2676)

  • Breaking: Removed points(number) from Plot.distFn and Plot.numericFn plots, replaced withxPoints(number[]). (#2768)

  • Fix ! operator: !0 now evaluates to true, and !1 to false (#2658)

Other changes

  • Fix pointwise combination precision issues on discrete PointSet dists. This was affecting mixture and pointwise operators. (#2514)

  • Expose getFunctionDocumentation function to render documentation in the playground (#2583)

@quri/squiggle-components

  • Updated distribution charts to be prettier and better support different sizes (#2782)

  • Tooltips and inline documentation for stdlib functions in editor (#2583)

  • New dropdown menu on each value in viewer (#2549)

  • Hide calculator top when empty, auto-close widgets with strings of less than 25 chars, expose errors when items are focused. (#2547)

  • Calculator result functions no longer re-run on input changes (#2525)

  • Added window.squiggleOutput output for debugging (#2564)

  • Show vertical lines when distribution summary table cells are hovered (#2585)

@quri/prettier-plugin-squiggle

  • Improved formatting for pipe statements and newlines (b5d1394)

vscode-squiggle

  • Use 0.9.0 Squiggle

  • Convert webview implementation to TypeScript

Edit on GitHub

Last updated on

On this page