Fork of daniellemaywood.uk/gleam — Wasm codegen work
2

Configure Feed

Select the types of activity you want to include in your feed.

gleam / CHANGELOG.md
94 kB 2095 lines
1# Changelog 2 3## Unreleased 4 5### Compiler 6 7- Prepending to lists in JavaScript (`[x, ..xs]` syntax) has been optimised. 8- Function stubs are no longer generated for functions that do not have an 9 implementation for the current targeting being compiled for. 10- Fixed a bug where some functions would not result in a compile error when 11 compiled for a target that they do not support. 12- Fixed a bug where sometimes a warning would not be emitted when a result is 13 discarded. 14- Fixed a bug with JavaScript code generation of pattern matching guards. 15- URLs in error messages have been updated for the new language tour. 16- Improved error message when erroneously trying to append items to a list using 17 the spread syntax (like `[..rest, last]`). 18- Generate [type references](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html#-reference-types-) 19 when compiling to JavaScript with TypeScript definitions enabled. 20- Fix a bug where JavaScript code generation would not properly return the 21 result of nested blocks. 22- Fix a bug where JavaScript code generation would not properly handle functions 23 returned by blocks. 24- Fix a bug where Erlang code generation would not properly handle list case patterns 25 with no head and a spread tail. 26- The compiler will now raise a warning if you're pattern matching on tuple 27 literals and suggest you use multiple subjects instead. 28- Fixed a bug where JavaScript code generation would incorrectly parenthesise a 29 return statement. 30- Added support for the [Bun](https://bun.sh/) runtime when compiling to 31 JavaScript by using `gleam run --target javascript --runtime bun` 32- Fixed a bug where `tuple.0.1` was not recognised as a nested tuple access 33 expression 34- Error messages are more clear about expecting values instead of types. 35- Fixed a bug where pattern matching on a string would cause the program to 36 crash on the JavaScript target. 37- Allow compilation of packages that require `"rebar"` using the rebar3 compiler. 38- A warning is now emitted when defining an opaque external type. 39- Improve error message when using incorrect quotes (`'`) to define a string 40 41### Formatter 42 43- The formatting of case expressions with multiple subjects has been improved. 44- Fixed a bug where the formatter would move comments from the end of bounded 45 expressions like lists, tuples, case expressions or function calls. 46- Fixed a bug where a record update's arguments would not be indented correctly. 47- Fixed a bug where function call arguments, tuple items and list items would be 48 needlessly indented if preceded by a comment. 49- Line endings other than `\n` are now handled by the formatter, preserving 50 blank lines and converting them to `\n`. 51 52### Build tool 53 54- A warning is now emitted if there is a `.gleam` file with a path that would be 55 invalid as a module name. 56- New projects are created with the GitHub `actions/checkout` v4 action. 57- Fixed a bug where bit arrays would break syntax highlighting in the generated 58 HTML documentation. 59- Dependencies that use Erlang-only bit options can now compile on JavaScript, 60 though the functions that use them will not be available for use in the root 61 package. 62- The output format of the command line help messages have been changed 63 slightly. 64- The command line help text now lists valid targets and runtimes. 65- Generated documentation no longer exposes the constructors of opaque types, 66 no longer exposes the values of constants, and indicates which types are 67 opaque. 68- Generated HTML documentation now includes a link to the package on Hex. 69- Terminal colors can now be forced by setting the `FORCE_COLOR` environment 70 variable to any non-empty value. 71- Rust's Reqwest's `webpki-roots` are now used for TLS verification. 72- Update Deno config to allow passing `--location` runtime flag. 73 74### Language Server 75 76- The `Compiling Gleam` message is no longer emitted each time code is compiled. 77 This is to reduce noise in editors that show this message prominently such as 78 Neovim. 79- Fixed a bug where hovering over an expression in the middle of a pipe would 80 give the wrong node. 81- Go to definition now works for values in dependency Gleam modules. 82 83 84## v1.0.0 - 2024-03-04 85 86### Language changes 87 88- Comments have been added to the JavaScript prelude to indicate which members 89 are in the public API and which are internal. 90 91### Build tool 92 93- Fixed a bug where the exported package interface would not have a module's 94 documentation. 95- Fixed a bug where the `export package interface` command would always 96 recompile the project ignoring the cache. 97 98 99## v1.0.0-rc2 - 2024-02-14 100 101### Bug fixes 102 103- Fixed a bug where the exhaustiveness checker could crash for some generic 104 types. 105 106### Formatter 107 108- The format used by the formatter has been improved in some niche cases. 109- Improved the formatting of long case guards. 110- The formatter can now format groups of imports alphabetically. 111 112 113## v1.0.0-rc1 - 2024-02-10 114 115### Language changes 116 117- Using a reserved word is now a compile error, not a warning. 118- Inexhaustive matches are now compile errors, not warnings. 119- The warning for an unused module alias now shows how to not assign a name to 120 the module. 121- Type aliases with unused type parameters now emit an error. 122- Type definitions with duplicate type parameters now emit an error. 123 124### Formatter 125 126- Now the formatter will nest pipelines and binary operators that are used as 127 function arguments, list items or as tuple items. 128- The format function literals used as the last argument in a function call 129 on long lines has been improved. 130 131### Build tool 132 133- If a package contains a `todo` expression then the build tool will now refuse 134 to publish it to Hex. 135- The search bar in generated docs now has a darker background color. 136- `gleam export` now takes a `package-interface` option to export a json file 137 containing metadata about the root package. 138- `gleam docs build` now creates a json file containing metadata about the root 139 package. 140- The order of dependencies in `manifest.toml` is now in alphabetical order. 141- The search bar in generated docs now has a darker background color. 142- The generated docs no longer shows whether an argument is discarded or 143 not in a function signature. 144- It is now possible to use `gleam run -m` to run a dependency module even if 145 that dependency uses a compile target that your project does not support. 146 147### Bug fixes 148 149- Fixed a bug the build tool could be make to attempt to run a main function 150 that does not support the current target in some circumstances. 151- Fixed a bug where the exhaustiveness checker could crash when checking nested 152 values inserted into the parent type using type parameters. 153- Fixed a bug where `functionname(_name)` would incorrectly parse as a function 154 capture instead of a syntax error. 155- Fixed a bug where external only functions would "successfully" compile for a 156 target they do not support, leading to a runtime error. 157 158 159## v0.34.1 - 2023-01-17 160 161### Build tool changes 162 163- Support has been added for using SourceHut as a repository. 164 165### Bug fixes 166 167- Fixed a bug where long function headers with external implementations could 168 format incorrectly. 169- The `@deprecated` attribute can now be used to annotate module constants. 170 This will cause a warning to be emitted when the constant is used. 171 172 173## v0.34.0 - 2023-01-16 174 175## v0.34.0-rc3 - 2023-01-12 176 177### Language changes 178 179- "echo" is now a reserved word. 180- A warning is no longer emitted when a function has a Gleam implementation as 181 well as external implementations for both targets. This is because having a 182 default Gleam implementation means the code is future-proof and continues to 183 be cross platform even if a new target is added. 184 185### Bug fixes 186 187- Fixed a bug where function heads would go over the line limit in the 188 formatter. 189 190 191## v0.34.0-rc2 - 2023-01-11 192 193### Bug fixes 194 195- Fixed a bug where `gleam run` would fail when the current directory is not 196 the root of the project and using the JavaScript target. 197- Fixed a bug where the compiler would in some cases fail to error when an 198 application uses functions that do not support the current compilation 199 target. 200 201 202## v0.34.0-rc1 - 2024-01-07 203 204### Language changes 205 206- Warn about function body not being used, because it already has external 207 implementations for all targets. 208- It's now possible to compile a project with external functions in dependency 209 packages that are not supported by the compilation target so long as they are 210 not used on the current target. 211- The error message for when one imports a constructor instead of an homonymous 212 type has been improved. 213 214### Language Server Changes 215 216- Added a `View on HexDocs` link on function hover. 217 218### Formatter 219 220- Fixed some quirk with the formatting of binary operators. 221- Fixed a bug where the formatter would move a function call's closed 222 parentheses on a new line instead of splitting the function's arguments. 223- Now the formatter will format tuples as if they were functions, trying to 224 first split just the last element before splitting the whole tuple. 225- Improved the formatting of multiline strings in string concatenation. 226 227### Build tool changes 228 229- The `gleam new` command now accepts any existing path, as long as there are 230 no conflicts with already existing files. Examples: `gleam new .`, `gleam new 231 ..`, `gleam new ~/projects/test`. 232- The format for the README created by `gleam new` has been altered. 233- The `gleam.toml` created by `gleam new` now has a link to the full reference 234 for its available options. 235- The `gleam` binary is now statically linked on Windows. 236- New projects are created requiring between versions of v0.34.0 inclusive and 237 exclusive v2.0.0. 238- The `repository` section now supports additional VCS types in the form of 239 codeberg, forgejo and gitea allowing a `user`, `repo` and additionally a 240 `host` url. 241- TypeScript declaration for the prelude exports previously missing functions 242 and classes. Additionally, swaps interfaces for classes and adds missing 243 attributes to classes. 244- `gleam` commands now look in parent directories for a `gleam.toml` file. 245 246### Bug fixes 247 248- Fixed a bug where `gleam add` would not update `manifest.toml` correctly. 249- Fixed a bug where `fn() { Nil }()` could generate invalid JavaScript code. 250- Fixed a bug where the build tool would make unnecessary calls to the Hex API 251 when path dependencies are used. 252- Fixed a bug where `gleam new` would generate a gitignore with `build` rather 253 than `/build`. 254- Fixed where the types of generic constants could be incorrecly inferred. 255- `Utf8Codepoint` has been renamed to `UtfCodepoint` in `prelude.d.mts`. 256- Fixed a bug where `gleam deps list` would look in filesystem root instead of 257 the current directory. 258- Fixed a bug with the `isEqual` function in `prelude.js` where RegExps were 259 being incorrectly structurally compared and being falsely reported as being 260 equal. 261- JavaScript: export from `prelude.d.mts` in `gleam.d.mts` to fix the error: 262 "Type 'Result' is not generic". 263- Not providing a definition after some attributes is now a parse error. 264 265 266## v0.33.0 - 2023-12-18 267 268## v0.33.0-rc4 - 2023-12-17 269 270- The deprecated bit array options `binary` and `bit_string` have been removed. 271- The deprecated ambiguous type import syntax has been removed. 272- The deprecated `BitString` type has been removed. 273- The deprecated `inspect` functions and `BitString` type has been removed from 274 the JavaScript prelude. 275 276 277## v0.33.0-rc3 - 2023-12-17 278 279### Formatter 280 281- The formatter now tries to split long chains of binary operations around the 282 operator itself, rather than around other elements like lists or function 283 calls. 284 285### Bug fixes 286 287- Fixed a bug where string prefix aliases defined in alternative case branches 288 would all be bound to the same constant. 289 290 291## v0.33.0-rc2 - 2023-12-07 292 293### Language changes 294 295- The `\e` string escape sequence has been removed. Use `\u{001b}` instead. 296- Generated Erlang now disabled redundant case clause warnings as these are now 297 redundant due to exhaustiveness checking. 298 299### Bug fixes 300 301- Fixed a bug where the `\u` string escape sequence would not work with 302 on Erlang on the right hand side of a string concatenation. 303 304 305## v0.33.0-rc1 - 2023-12-06 306 307### Formatter 308 309- The formatter now tries to keep a function body and its arguments on a single 310 line by first trying to split only its last argument on multiple lines. 311- Fixed a bug where the formatter would move comments out of blocks. 312- `gleam format` now ignores the Gleam build directory by default, even when not 313 in a git repository. 314 315### Language changes 316 317- Gleam now has full exhaustiveness checking. Exhaustiveness issues have been 318 downgraded from errors to warnings so that existing Gleam code can be 319 upgraded to be exhaustive without breaking existing code. In a future version 320 they will be upgraded to errors. 321- The `!` operator can now be used in clause guards. 322- The words `auto`, `delegate`, `derive`, `else`, `implement`, `macro`, and 323 `test` are now reserved for future use. If used they will emit a warning. In 324 a future version this may be upgraded to an error. 325- The `\u{...}` syntax can be used in strings to specify unicode codepoints via a 326 hexadecimal number with 1 to 6 digits. 327- The `todo as` and `panic as` syntaxes now accept an expression that evaluates 328 to a string rather than just a string literal. 329 330### Build tool changes 331 332- The `gleam run` and `gleam test` commands gain the `-t` flag, which is an 333 alias of the `--target` flag. 334- The `gleam build`, `gleam check`, `gleam run` and `gleam test` commands now 335 also accept `js` and `erl` as values for the `--target` flag. 336- The `gleam new` command now creates packages at version 1.0.0. 337- The `gleam publish` command now asks for confirmation if the package being 338 published is not yet version 1.0.0. 339- The `gleam publish` command now asks for confirmation if the package name is 340 one that implies the package is maintained by the Gleam core team. 341- The error messages shown when dependency resolution fails have been improved. 342 343### Compiler WASM API 344 345- The WASM API for the compiler has been rewritten to be simpler. 346- The WASM API for the compiler now exposes warnings. 347 348### HTML documentation generator 349 350- Searching in rendered HTML documentation now also matches words that do not 351 start with the input but do contain it. 352 353### Bug fixes 354 355- Fixed a bug where the JavaScript code generator could generate invalid code 356 when pretty printing a zero arity function call when the line is over 80 357 columns wide. 358- Fixed a bug where the build directory could be left in an invalid state if 359 there is Elixir code to compile and running on Windows without permission to 360 create symlinks. 361- Fixed a bug where numbers with preceeding zeros could generate incorrect 362 JavaScript. 363- The Erlang code generated by the `/.` operator no longer generates a warning 364 for the upcoming negative zero float change in Erlang OTP 27. 365- Fixed a bug where using only types from an aliased import, wouldn't stop the 366 compiler from emitting an unused alias warning for that import. 367- Fixed a bug where the formatter would remove the ` as name` from string prefix 368 patterns. 369- Fixed a bug where the formatter would misplace comments at the start of a 370 block. 371- Fixed a bug where using a string prefix pattern in `let assert` would generate 372 incorrect JavaScript. 373 374 375## v0.32.4 - 2023-11-09 376 377### Build tool changes 378 379- The build tool now supports rebar3 and mix hex packages where the package name 380 differs from the otp application name. 381 382### bug fixes 383 384- Fixed a bug where invalid javascript code could be generated when a module 385 function calls another function that was passed as an argument and the 386 argument has the same name as the module function. 387- Fixed the `target` property of `gleam.toml` being ignored for local path 388 dependencies by `gleam run -m module/name` 389 390 391## v0.32.3 - 2023-11-07 392 393### Language changes 394 395- Imported modules can now be discarded by giving them an alias starting with `_`. 396 397### Build tool changes 398 399- New projects are now generated with the call to `gleam format` coming last in 400 the GitHub Actions workflow. This is so that feedback from tests is presented 401 even if formatting is incorrect. 402- Added Windows support for the `gleam export erlang-shipment` command. 403 404### Bug fixes 405 406- Fixed a bug where some nested pipelines could fail to type check. 407 408 409## v0.32.2 - 2023-11-03 410 411### Build tool changes 412 413- New Gleam projects are created with `gleam_stdlib` v0.32 and `gleeunit` v1.0. 414 415### Bug fixes 416 417- Fixed a bug where `gleam fix` would not produce correct results for code that 418 shadowed a prelude name with an import of the same name but a different kind. 419- Fixed a bug where documentation would not publish to Hexdocs for packages with 420 a number in the name. 421- Fixed a bug where aliased unqualified types and values of the same name could 422 produce an incorrect error. 423 424 425## v0.32.1 - 2023-11-02 426 427### Bug fixes 428 429- Fixed a bug where `gleam fix` would not produce correct results for code that 430 shadowed a prelude name with an import of the same name but a different kind. 431- Fixed a bug where incorrect JavaScript could be generated due to backwards 432 compatibility with the deprecated import syntax. 433 434 435## v0.32.0 - 2023-11-01 436 437### Bug fixes 438 439- Fixed a bug where running `gleam fix` multiple times could produce incorrect 440 results. 441 442 443## v0.32.0-rc3 - 2023-10-26 444 445### Bug fixes 446 447- Fixed a bug where `gleam fix` would fail to update the deprecated type import 448 syntax for aliased unqualified types. 449 450 451## v0.32.0-rc2 - 2023-10-26 452 453### Bug fixes 454 455- Fixed a bug where the backward compatibility for the deprecated import syntax 456 could result in an import error with some valid imports. 457 458 459## v0.32.0-rc1 - 2023-10-25 460 461### Language changes 462 463- Using `import module.{TypeName}` to import a type has been deprecated, 464 replaced by `import module.{type TypeName}`. In a future version of Gleam the 465 old syntax will only import the value of the same name. Run `gleam fix` to 466 update your code. 467- The `BitString` type has been renamed to `BitArray`. Run `gleam fix` to update 468 your code. 469- The `binary` and `bit_string` bit array modifier have been deprecated in favour 470 of `bytes` and `bits`. 471- The error message for when one element in a list doesn't match the others has 472 been improved. 473- The error message for when the elements of a list's tail don't match the 474 previous ones has been improved. 475- The error message for when one tries to access an unknown field has been 476 improved. 477- The `__gleam_prelude_variant__` property has been removed from the classes 478 defined in the JavaScript prelude. 479- The deprecated `todo("...")` syntax has been removed. 480- Module access can now be used in case clause guards. 481- The JS target now supports bit syntax for module constants. 482- The Erlang compiler will no longer emit a duplicate warning for unused 483 functions. 484- The `@deprecated` attribute can now be used with type definitions. 485- A warning is now emitted if a module alias is unused. 486 487### Language server changes 488 489- The language server now has a code action for removing unused items. 490- The language server now shows the type of variables defined using `use` on 491 hover. 492 493### Build tool changes 494 495- The `gleam check` command supports the `target` flag. 496- The `gleam fix` command updates code to use `BitArray` rather than `BitString`. 497- The `gleam fix` command updates code to use the new import type syntax. 498- `gleam fix` sets the `gleam` version constraint in `gleam.toml` to `>= 0.32.0`. 499- The `gleam` version constraint field in `gleam.toml` now disregards pre and 500 build components when checking for compatibility. 501- The prelude is no longer rendered once per package when compiling to 502 JavaScript, instead one copy is rendered for the entire project. If you are 503 using the `gleam compile-package` API you now need to give a path to the 504 prelude using the `--javascript-prelude` flag. 505- The `gleam export javascript-prelude` and `gleam export typescript-prelude` 506 commands have been added to export a copy of the prelude. This command may be 507 useful for build tools that use the compiler via the `gleam compile-package` 508 API. 509- Fixed a bug where some deprecation messages would not be printed. 510- The content has been made wider in rendered HTML documentation. 511- Dependencies that can be built with both `mix` and `rebar3` are now built 512 with `mix` if it exists on the system, and with `rebar3` if it doesn't. 513 514### Bug fixes 515 516- "Compiling $package" is now only printed when a package has new changes to 517 compile. 518- The main process started with `gleam run` no longer traps exits on Erlang. 519- The formatting of code in rendered HTML documentation has been improved. 520- The formatter no longer moves trailing comments out of custom type definitions. 521- Fixed a bug where some hexidecimal numbers would generate incorrect Erlang. 522- Fixed a bug where markdown tables would not render correctly in HTML 523 documentation. 524- The float 0.0 is now rendered in Erlang as `+0.0` to silence warnings in 525 Erlang/OTP 27. 526 527## v0.31.0 - 2023-09-25 528 529- New Gleam projects are created with `gleam_stdlib` v0.31, `actions/checkout` 530 v3.\*, and `erlef/setup-beam` v1.\*. 531- A note is included in the generated HTML documentation if a function is 532 deprecated. 533 534## v0.31.0-rc1 - 2023-09-18 535 536- The `@deprecated("...")` attribute can be used to mark a function as 537 deprecated. This will cause a warning to be emitted when the function is used. 538- A warning is now emitted if a module from a transitive dependency is imported. 539- Record access can now be used in case clause guards. 540- Fixed a bug where `manifest.toml` could contain absolute paths for path 541 dependencies. 542- The `as` keyword can now be used to assign the literal prefix to a variable 543 when pattern matching on a string. 544- The `if` conditional compilation, `external fn`, and `external type` syntaxes 545 have been removed. 546- The `description` flag for the `gleam new` command has been removed. 547- The highlight.js grammar included with generated HTML documentation has been 548 updated for the latest syntax. 549- Packages are no longer precompiled to Erlang when publishing to Hex if the 550 package target is set to JavaScript. 551- An exception is now raised if JavaScript code uses the `BitString` class 552 constructor and passes in the incorrect argument type. 553- Fixed a bug where mutually recursive functions could be incorrectly inferred 554 as having an overly general type. 555- Fixed a bug where recursive type constructors could incorrectly infer a type 556 error. 557- Fixed a bug where some mutually recursive functions would be inferred as 558 having too general a type. 559- Fixed a bug where constants where not being correctly inlined when used in the 560 size option of a bit string pattern match. 561- Fixed a bug where anonymous functions could parse successfully when missing a 562 body. 563- Fixed a bug where incorrect unused variable warnings could be emitted for code 564 that doesn't type check. 565- Fixed a bug where packages defaulting to the JavaScript target could have 566 modules missing from their HTML documentation when published. 567- Corrected some outdated links in error messages. 568- Hovering over a function definition will now display the function signature, 569 or the type of the hovered argument. 570- Use `import type` for importing types from typescript declarations. 571- Use `.d.mts` extension for typescript declarations to match `.mjs`. 572- Prefix module names with dollar sign in typescript to avoid name collisions. 573 574## v0.30.4 - 2023-07-26 575 576- External implementations are always referenced directly in generated code, to 577 avoid the overhead of an extra function call. 578- Fixed a bug where the compiler could infer incorrect generic type parameters 579 when analysing a module without type annotations with self recursive 580 functions that reference themselves multiple times. 581 582## v0.30.3 - 2023-07-23 583 584- Fixed a bug where JavaScript module path such as `node:fs` would be rejected. 585- New Gleam projects are created with `gleam_stdlib` v0.30, Erlang OTP v26.0.2, 586 Elixir v1.15.4, actions/checkout v3.5.1, and erlef/setup-beam v1.16.0. 587 588## v0.30.2 - 2023-07-20 589 590- Fixed a bug where the compiler could infer incorrect generic type parameters 591 when analysing a module without type annotations with self recursive 592 functions. 593- Fixed a bug where the formatter would incorrectly format external functions 594 by breaking the return annotation instead of the function arguments. 595 596## v0.30.1 - 2023-07-13 597 598- Fixed a bug where the language server could fail to import path dependencies 599 in monorepos. 600 601## v0.30.0 - 2023-07-12 602 603- A warning is now emitted for the deprecated external fn syntax. 604 605## v0.30.0-rc4 - 2023-07-10 606 607- An error is now emitted for invalid JavaScript external implementations. 608- Fixed a bug where Erlang external implementations could generate invalid code. 609 610## v0.30.0-rc3 - 2023-07-05 611 612- Fixed a bug where `gleam fix` would fail to parse command line flags. 613 614## v0.30.0-rc2 - 2023-07-03 615 616- Fixed a bug where `gleam fix` would merge external functions of the same name 617 but incompatible types. 618- Fixed a bug where external function arguments would incorrectly be marked as 619 unused. 620 621## v0.30.0-rc1 - 2023-06-29 622 623- The new `@target(erlang)` and `@target(javascript)` attribute syntax has been 624 added for conditional compilation. The existing `if` conditional compilation 625 syntax has been deprecated. Run `gleam fix` to update your code. 626- The new `type TypeName` syntax syntax replaces the `external type TypeName` 627 syntax. The existing external type syntax has been deprecated. Run `gleam format` 628 to update your code. 629- Adding a new dependency now unlocks the target package. This helps avoid 630 failing to find a suitable version for the package due to already being 631 locked. 632- A custom message can now be specified for `panic` with `panic as "..."`. 633- The syntax for specifying a custom message for `todo` is now `todo as "..."`. 634- The Erlang error raised by `let assert` is now tagged `let_assert`. 635- Types named `Dynamic` are now called `dynamic_` in Erlang to avoid a clash 636 with the new Erlang `dynamic` type introduced in OTP26. 637- Dependencies can now be loaded from paths using the 638 `packagename = { path = "..." }` syntax in `gleam.toml`. 639- The `javascript.deno.unstable` field in `gleam.toml` can now be used to 640 enable Deno's unstable APIs when targeting JavaScript. 641- Blockquotes are now styled in rendered HTML documentation. 642- The `gleam` property can be set in `gleam.toml` can be set to a version 643 requirement to specify the version of Gleam required to build the project. 644- Type aliases can now refer to type aliases defined later in the same module. 645- Fixed a bug where unapplied record constructors in constant expressions would 646 generate invalid Erlang. 647- Fixed a bug where the prescedence of `<>` and `|>` would clash. 648- Fixed a bug where `gleam docs build` would print an incorrect path upon 649 completion. 650- Warnings from dependency packages are no longer surfaced in the language 651 server. 652- A warning is now emitted when a Gleam file is found with an invalid name. 653- A warning is now emitted when using `list.length` to check for the empty list, 654 which is slow compared to checking for equality or pattern matching (#2180). 655- The new `gleam remove <package_name>` can be used to remove dependencies 656 from a Gleam project. 657- Fixed a bug where the formatter could crash. 658- Fixed a bug where invalid Erlang would be generated when piping into `panic`. 659- The `gleam docs build` command gains the `--open` flag to open the docs after 660 they are generated (#2188). 661- Fixed a bug where type annotations for constants could not be written with 662 type annotations. 663- Updated font loading in generated HTML documentation to fix an issue with 664 fonts not loading properly in some browsers (#2209). 665 666## v0.29.0 - 2023-05-23 667 668- New projects now require `gleam_stdlib` v0.29. 669 670## v0.29.0-rc2 - 2023-05-22 671 672- The `gleam lsp` command is no longer hidden from the help output. 673- Fixed a bug where some language server clients would show autocompletion 674 suggestions too eagerly. 675 676## v0.29.0-rc1 - 2023-05-16 677 678- The language server will now provide autocomplete suggestions for types and 679 values either imported or defined at the top level of the current module. 680- Fixed a bug where record patterns using the spread operator (`..`) to discard 681 unwanted arguments would not type check correctly when the record had no 682 labelled fields. 683- Add support for using sized binary segments in pattern matches when targeting 684 JavaScript. 685- A warning is now emitted for double unary negation on ints (`--`) and bools 686 (`!!`) as this does nothing but return the original value. 687- Previously the build tool would discard the entire build directory when dependencies 688 were changed. Now it will only discard the build artefacts for removed 689 dependencies. 690- The errors emitted when a name is reused in a module have been made clearer. 691- Fixed an incorrect URL in the error message for failing to parse a let binding 692 with a type annotation. 693- Fixed a bug where shadowing a prelude type name could result in incorrect 694 errors in exhaustiveness checking. 695- Fixed a bug where the language server would in some scenarios not remove an 696 error diagnostic after it becomes outdated. 697- Fixed a bug where the formatter would incorrectly format blocks with a comment 698 before them that were the only argument to a function call. 699- Fixed a bug where the language server would not reset the build directory when 700 it was created by a different version of Gleam. 701- New Gleam projects are created with `erlef/setup-beam@v1.15.4` in their GitHub 702 actions CI configuration. 703- Running a module now uses the dependency's target and runtime in its `gleam.toml`. 704 705## v0.28.3 - 2023-04-17 706 707- Fixed a bug where the language server would show outdated error diagnostics 708 when a new one was emitted in a different module. 709- Fixed a bug where the language server would attempt to analyse Gleam modules 710 that were outside of the `src` or `test` directories. 711- New Gleam projects are created with `actions/checkout@v3.5.1` and 712 `erlef/setup-beam@1.15.3` in their GitHub actions CI configuration. 713 714## v0.28.2 - 2023-04-10 715 716- Fixed a bug where comments above a `use` expression would be formatted 717 incorrectly. 718- Fixed a bug where the formatter would fail to preserve empty lines after a 719 block. 720- Fixed a bug where the formatter would fail to preserve empty lines after an 721 anonymous function with a return annotation. 722 723## v0.28.1 - 2023-04-05 724 725- Fixed a bug where the language server would unset too many error diagnostics 726 when multiple projects are open, more than one have errors, and one of them is 727 successfully compiled. 728- Fixed a bug where the language server would unset error diagnostics when 729 displaying information on hover. 730- Added support for type annotations in use statements. 731 732## v0.28.0 - 2023-04-03 733 734- New projects now require `gleam_stdlib` v0.28. 735 736## v0.28.0-rc3 - 2023-03-31 737 738- Fixed a bug where source links would be incorrect in HTML documentation. 739 740## v0.28.0-rc2 - 2023-03-27 741 742- Fixed a bug where single statement blocks inside binary operators could 743 generate invalid JavaScript. 744- Fixed a bug where the formatter could incorrectly place comments. 745- Fixed a bug where the language server would show outdated diagnostics when a 746 file with an error reverts to the previous valid version, causing the compiler 747 to use the cached version of the file. 748 749## v0.28.0-rc1 - 2023-03-26 750 751- The language server now analyzes files on edit rather than on save, providing 752 feedback faster. 753- The language server now supports editor sessions that span multiple projects. 754 This is useful for mono-repos and projects with both a frontend and backend in 755 Gleam. 756- The language server now also shows documentation on hover for expressions. 757- The language server now shows types and documentation on hover for patterns. 758- Added support for negation of integers with the new `-` unary operator. 759- Variable assignments are now only permitted within a function or a block, not 760 anywhere that an expression is permitted. 761- The deprecated `try` expression has been removed. 762- The deprecated `assert ... = ...` syntax has been removed. 763- Semicolons are no longer whitespace. An error will be emitted if one is 764 encountered. 765- Warnings are now immediately emitted rather than being buffered until the end 766 of the compilation. 767- The `--warnings-as-errors` flag is now supported by `gleam build`. 768- Blocks are now preserved by the formatter when they only have a single 769 expression within them. 770- Generated docs now export more meta data to improve the developer experience, 771 accessibility and search engine discoverability. 772- Files are now only recompiled if they have changed since the last compilation, 773 detected by file hash and modification time. Previously only the modification 774 time was used. 775- Autocompletion of module imports was removed due to a buggy implementation. 776- Fixed a bug where the formatter would incorrectly remove `{ ... }` from bit 777 string segment value expressions. 778- Fixed a bug where TypeScript type definitions files could include incorrect 779 type names. 780- Fixed a bug where the compiler used VSCode specific behaviour in the language 781 server which was incompatible with Helix. 782- Fixed a bug where string concatenation patterns on strings with escape 783 characters would generate javascript code with wrong slice index. 784- Fixed a bug where blocks could parse incorrectly. 785- Allow modules to be run with the `gleam run --module` command. 786 787## v0.27.0 - 2023-03-01 788 789- Fixed a bug where `panic` could generate incorrect JavaScript code. 790- New projects now require `gleam_stdlib` v0.27. 791 792## v0.27.0-rc1 - 2023-02-26 793 794- The new `panic` keyword can be used to crash the program. This may be useful 795 for situations in which a program has got into an unrecoverable invalid state. 796- `try` expressions are now deprecated and will be removed in a future version. 797- The new `gleam fix` command can be used to automatically convert `try` 798 expressions to `use` expressions. 799- `let assert ... = ...` is now the syntax for assertion assignments. The 800 `assert ... = ...` syntax is deprecated and will be removed in a future 801 version. Run `gleam format` to automatically update your code. 802- `gleam export hex-tarball` can be used to create a tarball suitable for 803 uploading to a Hex compatible package repository. 804- The unused private type and constructor detection has been improved. 805- The argument `--runtime` now accepts `nodejs` as the name for that runtime. 806 The previous name `node` is still accepted. 807- Patterns can now be used in `use` expressions. 808- Fixed a bug where string concatenation patterns could generate javascript 809 code with wrong slice index due to ut8/ut16 length mismatch. 810- The Erlang compiler will no longer emit a duplicate warning for unused 811 variables. 812- Fixed a bug where typescript type definitions for types with unlabelled 813 arguments where generated with an invalid identifier and unlabelled fields 814 were generated with a name that didn't match the javascript implementation. 815- Fixed a bug in the type inferrer were unannotated functions that were 816 used before they were defined in a module could in rare cased be inferred 817 with a more general type than is correct. 818- Fixed a bug where the LSP would fail to show type information on hover for 819 expressions after a use expression. 820- Fixed a bug where imported constants could generated incorrect JavaScript 821 code. 822- Fixed a bug where the LSP would perform codegen for dependencies. 823- Fixed a bug where the LSP would compile native dependencies needlessly. 824- Fixed a bug where integer division with large numbers on JavaScript could 825 produce incorrect results. 826- Fixed a bug where pattern matches on custom types with mixed labelled and 827 unlabelled arguments could not be compiled when targeting JavaScript. 828- Fixed a bug where local variables in case guard constant expressions caused 829 the compiler to panic. 830- The formatter now truncates meaningless zeroes of floats' fractional parts. 831- Anonymous functions may now have an empty body. The compiler will emit a 832 warning for functions without a body, and these functions will crash at 833 runtime if executed. 834- Fixed bug where raised errors on JS would have an extra stack frame recorded 835 in them. 836 837## v0.26.2 - 2023-02-03 838 839- The formatter now wraps long `|` patterns in case clauses over multiple lines. 840- Fixed a bug where unlabelled function arguments could be declared after 841 labelled ones. 842- A broken link was removed from the error messages. 843- Fixed a bug where using a qualified imported record constructor function as a 844 value would produce invalid Erlang code if the name of the record variant was 845 an Erlang reserved word. 846 847## v0.26.1 - 2023-01-22 848 849- New projects now require `gleeunit` v0.10. 850- Rebar3 dependency projects are now compiled in-place. This fixes an issue 851 where some NIF using projects would fail to boot due to some paths not being 852 copied to the `build` directory. 853- An error is now emitted if a list spread expression is written without a tail 854 value. 855- An error is now emitted when a function is defined with multiple arguments 856 with the same name. 857- The error message emitted when a `let` does not match all possible values has 858 been improved. 859- Fixed a bug where the language server wouldn't analyse test code. 860- Fixed a bug where `assert` expressions can generate invalid Erlang. 861 warning. 862- Fixed a bug where arguments would be passed incorrectly to Deno. 863- Fixed a bug where defining variables that shadow external functions could 864 generate invalid JavaScript. 865 866## v0.26.0 - 2023-01-19 867 868[Release blog post](https://gleam.run/news/v0.26-incremental-compilation-and-deno/) 869 870- New projects require `gleam_stdlib` v0.26 and `gleeunit` v0.9. 871- Fixed a bug where JavaScript default projects would fail to publish to Hex. 872 873## v0.26.0-rc1 - 2023-01-12 874 875- Added support for Deno runtime for JavaScript target. 876- Scientific notation is now available for float literals. 877- The compiler now supports incremental compilation at the module level. If a 878 module or its dependencies have not been changed then it will not be 879 recompiled. 880- The format used by the formatter has been improved. 881- 4 digit integers are now always formatted without underscores. 882- Running `gleam new` will skip `git init` if the new project directory is 883 already part of a git work tree. 884- Generated HTML documentation now includes all static assets, including web 885 fonts, so that it can be accessed offline and in future once CDNs would 404. 886- Generated HTML documentation now supports TypeScript syntax highlighting. 887- New Gleam projects are created using GitHub actions erlef/setup-beam@v1.15.2. 888- Some modules can now be hidden from the docs by specifying a list of glob 889 patterns in `internal_modules` in `gleam.toml`. The default value for this 890 list is `["$package_name/internal", "$package_name/internal/*"]`. 891- The `gleam new` command gains the `--skip-git` flag to skip creation of 892 `.git/*`, `.gitignore` and `.github/*` files. 893- The `gleam new` command gains the `--skip-github` flag to skip creation of 894 `.github/*` files. 895- Fixed a bug where no error would be emitted if a `src` module imported a 896 `test` module. 897- Fixed a bug where comments in list prepending expressions could be formatted 898 incorrectly. 899- Fixed a bug where comments in record update expressions could be formatted 900 incorrectly. 901- Fixed a bug where long `use` expressions could be formatted incorrectly. 902- Fixed a bug integer multiplication would overflow large integers when 903 compiling to JavaScript. 904- Fixed `int` and `float` formatting in `const`s and patterns. 905- Fixed a bug where piping into a function capture expression with a pipe as one 906 of the arguments would produce invalid Erlang code. 907- Formatter no longer removes new lines in expression blocks within case branches 908 909## v0.25.3 - 2022-12-16 910 911- 4 digit integers are no longer automatically formatted with underscores. 912 913## v0.25.2 - 2022-12-16 914 915- Updated `actions/checkout` from `actions/checkout@v3.0.0` to `@v3.2.0` for 916 projects created via `gleam new`. 917- Fixed a bug where `gleam new` would set a `Rebar3` version to `25.1` 918 instead of the latest stable `3`. 919- Updated following runtime versions set via `gleam new`: `Erlang/OTP` 920 to `25.2`, and `Elixir` to `1.14.2`. 921- The formatter now inserts underscores into larger `Int`s and the larger 922 integer parts of `Float`s. 923- Added support for top level TypeScript file inclusion in builds. 924- The build tool will now favour using rebar3 over Mix for packages that support 925 both. This fixes an issue where some packages could not be compiled without 926 Elixir installed even though it is not strictly required. 927 928## v0.25.1 - 2022-12-11 929 930- New Gleam projects are now configured to explicitly install rebar3 using 931 GitHub actions erlef/setup-beam. 932- A better error message is now shown when attempting to use a function within a 933 constant expression. 934- Changed float size limit in bit string expressions to 16, 32 or 64, when static. 935 Also allowed dynamic size. 936- New Gleam projects are created using GitHub actions erlef/setup-beam@v1.15.0. 937- Fixed a bug where returning an anonymous function from a pipeline and calling 938 it immediately without assigning it to a variable would produce invalid Erlang 939 code. 940- Fixed a bug where the formatter would remove the braces from negating boolean 941 expressions. 942 943## v0.25.0 - 2022-11-24 944 945[Release blog post](https://gleam.run/news/v0.25-introducing-use-expressions/) 946 947## v0.25.0-rc2 - 2022-11-23 948 949- Fixed a bug where Gleam dependency packages with a `priv` directory could fail 950 to build. 951- Fixed a regression where Elixir and Erlang Markdown code blocks in generated 952 documentation would not be highlighted. 953 954## v0.25.0-rc1 - 2022-11-19 955 956- Generated HTML documentation now includes the `theme-color` HTML meta tag. 957- The `use` expression has been introduced. This is a new syntactic sugar that 958 permits callback using code to be written without indentation. 959- Nightly builds are now also published as OCI container images hosted on 960 GitHub. 961- Fixed a bug where the build tool would not hook up stdin for Gleam programs it 962 starts. 963- Fixed a bug where using a record constructor as a value could generate a 964 warning in Erlang. 965- Fixed a bug where the build tool would use precompiled code from Hex packages 966 rather than the latest version, which could result in incorrect external 967 function usage in some cases. 968- Fixed a bug where the warning for `todo` would not print the type of the code 969 to complete. 970- Fixed a bug where `try` expressions inside blocks could generate incorrect 971 JavaScript. 972- Generated HTML documentation now includes all static assets (but the web 973 fonts), so that it can be accessed offline or in far future once CDNs would 404. 974- New Gleam projects are created using GitHub actions erlef/setup-beam@v1.14.0 975- The `javascript.typescript_declarations` field in `gleam.toml` now applies to 976 the entire project rather than just the top level package. 977- The formatter now adds a `0` to floats ending with `.` (ie `1.` => `1.0`). 978- New projects require `gleam_stdlib` v0.25. 979 980## 0.24.0 - 2022-10-25 981 982[Release blog post](https://gleam.run/news/gleam-v0.24-released/) 983 984## 0.24.0-rc4 - 2022-10-23 985 986- Fixed a bug where the string concatenate operator could produce invalid Erlang 987 code when working with pipe expressions. 988 989## 0.24.0-rc3 - 2022-10-20 990 991- Fixed a bug where the OOP method call error hint would be shown on too many 992 errors. 993- Fixed a bug where the string concatenate operator could produce invalid Erlang 994 code when working with constant values. 995 996## 0.24.0-rc2 - 2022-10-18 997 998- Fixed a bug where imported and qualified record constructors used in constant 999 expressions could fail to resolve. 1000 1001## 0.24.0-rc1 - 2022-10-15 1002 1003- Gleam can now compile Elixir files within a project's `src` directory. 1004- The `<>` operator can now be used for string concatenation and for string 1005 prefix pattern matching. 1006- Fixed a bug where TypeScript definitions may have incorrect type parameters. 1007- New projects depend on `gleam_stdlib` v0.24. 1008- New projects' GitHub Actions config specifies Erlang/OTP 25.1 and suggest 1009 Elixir 1.14.1. 1010- If you attempt to use the method call syntax (`thing.method()`) on a value 1011 without that field the error message will now include a hint explaining that 1012 Gleam is not object oriented and does not have methods. 1013- Fixed a bug in the formatter where multiple line documentation comments for 1014 custom type constructor fields could be formatted incorrectly. 1015- Fixed a bug where tail call optimisation could be incorrectly applied when 1016 compiling to JavaScript in some situations. 1017- Fixed a bug where the remainder operator would return NaN results when the 1018 right hand side was zero when compiling to JavaScript. 1019- Fixed a bug where Elixir dependencies would fail to compile on Windows. 1020- Fixed a bug where images added to HTML documentation via documentation 1021 comments would not have a max width. 1022 1023## v0.23.0 - 2022-09-15 1024 1025[Release Blog Post](https://gleam.run/news/gleam-v0.23-released/) 1026 1027## v0.23.0-rc2 - 2022-09-15 1028 1029- New Gleam projects are created using GitHub actions erlef/setup-beam@v1.13.0 1030 and actions/checkout@v3.0.0. 1031- New Gleam projects are created using version v0.23.0 of the stdlib. 1032- Fixed a bug where LSP hovering would fail to locate the expression. 1033 1034## v0.23.0-rc1 - 2022-09-01 1035 1036- Gleam can now build dependency packages that are managed using Mix. 1037- Compiler performance has been improved by buffering disc writing and by lazily 1038 loading TLS certs. In testing this doubles performance when compiling the 1039 standard library. 1040- The `gleam publish` command now adds the `priv` directory and any `NOTICE` 1041 file to the tarball. 1042- The `gleam update` command can now be used to update dependency packages to 1043 their latest versions. 1044- Module functions with empty bodies are no longer syntax errors. 1045- The format used by the formatter has been improved. 1046- OpenSSL swapped out for RustTLS. 1047- Generated HTML documentation now includes a search bar. 1048- The LSP will now provide autocompletion for imports. 1049- A helpful error message is now returned when assignments are missing either a 1050 keyword or a value. 1051- Qualifiers are now used when multiple types have the same name in an error 1052 message. 1053- In JavaScript, if an object has defined an `equals` method in its prototype, 1054 Gleam will now use this method when checking for equality. 1055- Functions can now be defined and referenced in constant expressions. 1056- An error is now raised if the record update syntax is used with a custom type 1057 that has multiple constructors. 1058- An error is now raised if a module is imported multiple times. 1059- Fixed a bug where defining a type named `CustomeType` would product invalid 1060 JavaScript. 1061- Fixed a bug where defining a variable with the same name as an unqualified 1062 import would produce invalid JavaScript. 1063- Fixed a bug where piping to `todo` would generate invalid Erlang code. 1064- Fixed a bug where inspecting a JavaScript object with a null prototype would 1065 crash. 1066- Fixed a bug where the formatter could crash if source code contained 3 or more 1067 empty lines in a row. 1068- Fixed a bug where the formatter would remove braces from blocks used as the 1069 subject of a case expression. 1070- Fixed a bug alternative patterns with a clause containing a pipe with a pipe 1071 after the case expresson could render incorrect Erlang. 1072- Fixed a bug where formatter would strip curly braces around case guards even 1073 when they are required to specify boolean precedence. 1074- Fixed a bug where `gleam new` would in some situations not validate the 1075 target directory correctly. 1076- Fixed a bug where pipes inside record update subjects could generate invalid 1077 Erlang. 1078- Fixed a bug where pipes inside record access could generate invalid Erlang. 1079 1080## v0.22.1 - 2022-06-27 1081 1082- The `gleam publish` confirmation prompt now accepts both "Y" and "y". 1083- Fixed a bug where `todo` would not emit the correct line number to the LSP while. 1084 1085## v0.22.0 - 2022-06-12 1086 1087[Release Blog Post](https://gleam.run/news/gleam-v0.22-released/) 1088 1089- New projects are created with `gleam_stdlib` v0.22. 1090 1091## v0.22.0-rc1 - 2022-06-12 1092 1093- Fixed a bug where doc comments would dissociate from their statements when 1094 generating html documentation. 1095- You are now allowed to use named accessors on types with multiple constructors if the 1096 accessor's name, position and type match (among the constructors) (#1610). 1097- Added the ability to replace a release up to one hour after it is published 1098 using `gleam publish --replace`. 1099- `gleam publish`, `gleam docs publish`, `gleam docs remove`, `gleam hex retire`, 1100 and `gleam hex unretire` now have access to environment variables for 1101 username (default key `HEXPM_USER`) and password (default key `HEXPM_PASS`) 1102- The `gleam publish` command gains the `-y/--yes` flag to disable the "are you 1103 sure" prompt. 1104- Clear outdated files from the build directory after compilation. 1105- Fixed a bug where immediately calling the value that a case expression 1106 evaluates to could generate invalid JavaScript. 1107- Fixed a bug where the default project target is set to JavaScript, 1108 but the project would run on target Erlang instead. 1109- The compiler is now able to generate TypeScript declaration files on target 1110 JavaScript (#1563). To enable this edit `gleam.toml` like so: 1111 1112 ```toml 1113 [javascript] 1114 typescript_declarations = true 1115 ``` 1116 1117- Fixed a bug where argument labels were allowed for anonymous functions. 1118- Fixed a bug where JavaScript code could be invalid if a variable is defined 1119 inside an anonymous function with a parameter with the same name as the 1120 variable. 1121- Fixed a bug where importing a JavaScript function named "then" could produce 1122 invalid code. 1123- Fixed a bug where constants that reference locally defined custom types could 1124 render invalid JavaScript. 1125- The project generator will no longer permit use of the reserved `gleam_` 1126 prefix. 1127- Generated HTML docs easter egg updated. 1128- `gleam export erlang-shipment` can be used to create a directory of compiled 1129 Erlang bytecode that can be used as a deployment artefact to get your 1130 application live. 1131- `gleam format` will now preserve (up to one) empty lines between consecutive 1132 comments, as well as between comments and any following expression 1133- The deprecated rebar3 integration has been removed. 1134- Fixed a bug where `gleam format` would output an unwanted newline at the top 1135 of documents that only contain simple `//` comments. 1136- No longer add `dev-dependencies` to generated `.app` Erlang files unless 1137 we're compiling the root project (#1569). 1138- Fixed a bug where the formatter could render a syntax error with lists on long 1139 unbreakable lines. 1140- Fixed a bug where JavaScript variable names could be incorrectly reused. 1141- Fixed a bug where `gleam format` would remove the braces around a tuple index 1142 access when accessing a field of the returned element. 1143- Fixed a bug case clause guards could render incorrect JavaScript if a variable 1144 name was rebinded in the clause body. 1145- The `gleam compile-package` command no longer generates a `.app` file. This 1146 should now be done by the build tool that calls this command as it is 1147 responsible for handling dependencies. 1148- Fixed a bug where piping a list tail would create invalid Erlang code (#1656). 1149 1150## v0.21.0 - 2022-04-24 1151 1152[Release Blog Post](https://gleam.run/news/v0.21-introducing-the-gleam-language-server/) 1153 1154- New projects are created with `gleam_stdlib` v0.21. 1155 1156## v0.21.0-rc2 - 2022-04-20 1157 1158- Added the ability to replace a release up to one hour after it is published 1159 using `gleam publish --replace`. 1160- The language server will now enter a degraded mode that only performs 1161 formatting if running in a directory that is not a Gleam project with a 1162 `gleam.toml`. 1163 1164## v0.21.0-rc1 - 2022-04-16 1165 1166- The Gleam language server is here! This will provide IDE like features for 1167 code editors that support LSP, including but not limited to VSCode, Neovim, 1168 Emacs, Eclipse, Visual Studio, and Atom. This first version includes these 1169 features: 1170 - Project compilation. 1171 - Inline errors and warnings. 1172 - Type information on hover. 1173 - Go-to definition. 1174 - Code formatting. 1175- Fixed a bug in generated JavaScript code where functions named `then` would 1176 cause errors when dynamically imported. 1177- Initialize `git` repo when creating a new project. 1178- Log messages controlled with `GLEAM_LOG` now print to standard error. 1179- Log message colours can be disabled by setting the `GLEAM_LOG_NOCOLOUR` 1180 environment variable. 1181- You can now specify multiple packages when using `gleam add`. 1182- Bools can now be negated with the `!` unary operator. 1183- If the compiler version changes we now rebuild the project from scratch on 1184 next build command to avoid issues arising from reading metadata in an old 1185 format (#1547). 1186- Updated the "Unknown label" error message to match other error messages 1187 (#1548). 1188- Type holes are now permitted in function arguments and return annotations 1189 (#1519). 1190- Unused module imports now emit a warning (#1553). 1191- The error message for failing to parse a multiline clauses without curly 1192 braces has been improved with a hint on how to fix the issue (#1555). 1193- The error messages for when rebar3 or Erlang are missing from the machine has 1194 been improved with a tip on how to install them (#1567). 1195- Corrected the hint given with certain int and float binary operator type 1196 errors. 1197- Add support for `int` and `float` bit string type when compiling to JavaScript. 1198- Add support for specifying size of integers in a bit string. Supports only exact binaries, 1199 i.e. length is a multiple of 8. 1200- Fixed compilation of rebar3 based dependencies on Windows. 1201 1202## v0.20.1 - 2022-02-24 1203 1204- The type checker has been improved to enable use of the record access syntax 1205 (`record.field`) in anonymous functions passed into higher order functions 1206 without additional annotations. 1207 1208## v0.20.0 - 2022-02-23 1209 1210[Release Blog Post](https://gleam.run/news/gleam-v0.20-released/) 1211 1212- New projects are created with `gleam_stdlib` v0.20. 1213 1214## v0.20.0-rc1 - 2022-02-20 1215 1216- Type unification errors involving user annotated types now refer to the names 1217 specified by the user instead of internal rigid-type ids. 1218- The build tool now validates that listed licenses are valid SPDX expressions. 1219- A WebAssembly version of the compile is now available for use in JavaScript 1220 and other WebAssembly environments. 1221- New projects include Hex badges and a link to Hexdocs. 1222- Enhance type mismatch errors in the presence of try. 1223- Enhance type mismatch error for an inconsistent try. 1224- Enhance type mismatch error for pipe expressions to show the whole pipeline 1225 and not only its first line. 1226- Fixed a bug where sometimes type variable could be reused result in incorrect 1227 non-deterministic type errors. 1228- Built in support for the Mix build tool has been removed. The `mix_gleam` 1229 plugin is to be used instead. 1230- Introduce a limited form of exhaustiveness checking for pattern matching 1231 of custom types, which only checks that all constructor tags are covered 1232 at the top level of patterns. 1233- The `ebin` directory is now copied to the build directory for rebar3 managed 1234 dependencies if present before compilation. 1235- The format used by the formatter has been improved. 1236- Package names in `gleam.toml` are validated when the config is read. 1237- The `priv` directory is linked into the build directory for Gleam projects 1238 managed by the build tool. 1239- Fixed a bug where type errors from pipes could show incorrect information. 1240- Fixed a bug where types could not be imported if they had the same name as a 1241 value in the prelude. 1242 1243## v0.19.0 - 2022-01-12 1244 1245Dedicated to the memory of Muhammad Shaheer, a good and caring man. 1246 1247[Release Blog Post](https://gleam.run/news/gleam-v0.19-released/) 1248 1249## v0.19.0-rc4 - 2022-01-10 1250 1251- New projects are created with `gleam_stdlib` v0.19 and `gleeunit` v0.6. 1252- Fixed a bug where external functions could be specified with the wrong module 1253 name in generated Erlang when imported from a nested module in another 1254 package. 1255- Fixed a bug where warnings wouldn't get printed. 1256 1257## v0.19.0-rc3 - 2022-01-07 1258 1259- Fixed a bug where precompiled packages would fail to compile due to Erlang 1260 files being compiled twice concurrently. 1261 1262## v0.19.0-rc2 - 2022-01-06 1263 1264- Erlang modules are now compiled in a multi-core fashion. 1265- New projects are created with `erlef/setup-beam` v1.9.0 instead of 1266 `gleam-lang/setup-erlang` and `gleam-lang/setup-gleam`. 1267- Fixed a bug where tail call optimisation could generate incorrect code when 1268 the function has argument names that are JavaScript keywords. 1269- Fixed a bug where the build would continue when dependency packages failed to 1270 compile. 1271- Fixed a bug where `include` directories would not be accessible by the Erlang 1272 compiler during Gleam compilation. 1273 1274## v0.19.0-rc1 - 2022-01-03 1275 1276- The build tool now supports the JavaScript target. The target can be specified 1277 in either `gleam.toml` or using the `--target` flag. 1278- The `gleam check` command has been introduced for rapidly verifying the types 1279 of Gleam code without performing codegen. 1280- `true` and `false` can no longer be used as pattern matching variables, to 1281 avoid accidental uses of incorrect syntax that is popular in other languages. 1282 An error will hint about using Gleam's `True` and `False` values instead. 1283- You can now remove build artifacts using the new `gleam clean` command. 1284- The `compile-package` can now generate `package.app` files and compile source 1285 modules to `.beam` bytecode files. 1286- The flags that `compile-package` accepts have changed. 1287- Published Hex packages now include precompiled Erlang files. 1288- Erlang record headers are now written to the `include` directory within the 1289 package build directory. 1290- The format used by the formatter has been improved. 1291- Fixed a bug where tail recursion could sometimes generated incorrect 1292 JavaScript code. 1293- Performance of code generators has been slightly improved. 1294- Allow the record in a record expansion to be an expression that returns a 1295 record. 1296- Fixed a bug where external function module names would not be escaped 1297 correctly if they contained special characters and were assigned to a 1298 variable. 1299- A helpful error message is shown if Erlang is not installed. 1300 1301## v0.18.2 - 2021-12-12 1302 1303- Erlang applications are now automatically started when the VM is started by 1304 `gleam run` and `gleam test`. 1305 1306## v0.18.1 - 2021-12-12 1307 1308- Fixed a bug where pipe expressions in record updates and operator expressions 1309 could generate incorrect Erlang code. 1310- The `priv` directory is now copied to the output directory for rebar3 packages 1311 prior to compilation. This is required for some packages to compile. 1312- Fixed a bug where deps that fail to compile would be skipped when compilation 1313 would next be attempted, resulting the project being in an invalid state. 1314 1315## v0.18.0 - 2021-12-06 1316 1317[Release Blog Post](https://gleam.run/news/gleam-v0.18-released/) 1318 1319- New projects now include `gleeunit`. 1320 1321## v0.18.0-rc3 - 2021-12-05 1322 1323- URL format in gleam.toml is now validated. 1324- The `gleam deps list` command has been added. 1325- Fixed a bug where changing requirements in `gleam.toml` would not cause deps 1326 to be re-resolved. 1327- Fixed a bug where locked deps would cause incompatible package requirements to 1328 be discarded. 1329- Development dependencies are now included in the applications listed in the 1330 generated OTP `.app` file. 1331- `gleam.toml` now includes an `erlang.extra_applications` key to specify extra 1332 OTP applications that need to be started. 1333 1334## v0.18.0-rc2 - 2021-11-26 1335 1336- Fixed a bug where OTP .app files would be generated with invalid syntax. 1337- Removed extra whitespace from newly generated projects. 1338 1339## v0.18.0-rc1 - 2021-11-25 1340 1341- Gleam can now compile Gleam projects. 1342- Gleam can now run tests with the `gleam eunit` command. 1343- Gleam can now run programs with the `gleam run` command. 1344- Gleam can now run an Erlang shell with the `gleam shell` command. 1345- Gleam can now resolve package versions for a Gleam project's dependency tree. 1346- Gleam can now download Hex packages. 1347- Gleam can now build dependency packages that are managed using Gleam or 1348 rebar3. 1349- Gleam is now the default build tool for new projects. 1350- The template names for `gleam new` have been changed. 1351- Fixed a bug where the error message for a record update with an unknown field 1352 would point to all the fields rather than the unknown one. 1353- Improved styling for inline code in generated documentation. 1354- New projects use v0.18 of the stdlib. 1355 1356## v0.17.0 - 2021-09-20 1357 1358[Release Blog Post](https://gleam.run/news/gleam-v0.17-released/) 1359 1360- Functions now get special handling when being printed from JavaScript. 1361 1362## v0.17.0-rc2 - 2021-09-19 1363 1364- Errors thrown when no case clause or assignment pattern matches the subject 1365 value now include more debugging information when targeting JavaScript. 1366- New projects are generated using `gleam_stdlib` v0.17.1. 1367 1368## v0.17.0-rc1 - 2021-09-11 1369 1370- Redesigned the Gleam prelude to be a module of core classes when compiling to 1371 JavaScript. This improves the resulting generated code and makes debugging and 1372 interop easier. 1373- Projects without rebar3 can be generated using the `gleam-lib` template. 1374- JavaScript modules are imported using a camel case variable name to avoid name 1375 collisions with variables. 1376- Pipelines now use assignments in the generated code in order to preserve the 1377 order of any side effects. 1378- Fixed a bug where the compiler would crash rather than raise an error if a 1379 project contained a single module and attempted to import another. 1380- Special variable naming has been made more consistent in rendered Erlang and 1381 JavaScript. 1382- Conditional compilation can now be used to have different code within a module 1383 when compiling to a specific target. 1384- Fixed a bug where `todo` caused values not to be returned in JavaScript. 1385- Fixed a bug where multiple discarded function arguments generated invalid 1386 JavaScript. 1387- Fixed a bug where using JavaScript reserved words as function argument names 1388 caused generated invalid JavaScript. 1389- Fixed a bug where a case expression of just a catch-all pattern generated 1390 invalid JavaScript. 1391- Fixed a bug where the formatter would incorrectly render extra newlines below 1392 try expressions. 1393- Fixed a bug where tail recursive functions with arguments with the same name 1394 as JavaScript reserved words generated the wrong JavaScript. 1395- Fixed a bug where list equality would be incorrectly reported in JavaScript. 1396- Multiple subjects are now supported for case expressions in JavaScript. 1397- Fixed a bug where matching using a Bool or Nil literal as the subject for a 1398 case expression would produce invalid code when compiling to JavaScript. 1399- Unsupported feature error messages now include file path and line numbers for 1400 debugging. 1401- Bit string literals with no segment options or just the `bit_string`, `utf8` 1402 or `utf8_codepoint` options can be constructed when compiling to JavaScript. 1403- The format of generated JavaScript has been improved. 1404- Fixed a bug where rendered JavaScript incorrectly incremented variables when 1405 reassigned in patterns. 1406- Added `eval` and `arguments` to JavaScript reserved words. 1407- Support for the deprecated `tuple(x, y, ...)` syntax has been removed in favor 1408 of the more concise (`#(x, y, ...)`). Use `gleam format` with the previous 1409 version of the compiler to auto-migrate. 1410- New OTP projects are generated using `gleam_otp` v0.1.6. 1411- Fixed a bug where the equality operators could return the incorrect value for 1412 records when compiling to JavaScript. 1413- Fixed a bug where `todo` could sometimes render invalid JavaScript when used 1414 as an expression in the generated code. 1415- An error is now emitted if the list spread syntax is used with no prepended 1416 elements `[..xs]`. 1417- Fixed a bug where type errors inside piped expressions would be incorrectly be 1418 reported as being an incorrect usage of the pipe operator. 1419- Gleam modules with no public exports no longer render private members in 1420 Erlang. 1421- Fixed a bug where discard variables used in assert assignments would generate 1422 invalid Erlang code. 1423- Fixed a bug where some expressions as case subjects would generate invalid 1424 JavaScript code. 1425- Fixed a bug where some assignments as the final expression in a function would 1426 not return the correct value in JavaScript. 1427- Gleam packages imported in JavaScript now have the path prefix 1428 `gleam-packages`. This can be served from your web server or aliased in your 1429 `package.json` for NodeJS projects. 1430- Fixed a bug where the type checker would fail to generalise some type 1431 variables, causing module metadata writing to fail. 1432- Fixed a bug where tail call optimisation when compiling to JavaScript could 1433 result in incorrect code. 1434- Fixed a bug where variable names could be rendered incorrectly in closures. 1435- An error is now emitted if alternative patterns fail to define all the 1436 variables defined by the first pattern. 1437- New projects are generated using `gleam_stdlib` v0.17.0. 1438- New projects are generated using `gleam_otp` v0.2.0. 1439 1440## v0.16.1 - 2021-06-21 1441 1442- Values which are being imported more than once in an unqualified fashion now 1443 cause an error to be reported. 1444- Argument docs for custom type constructors are now rendered in the HTML 1445 documentation. 1446- Patterns can be used with `try` expressions when compiling to JavaScript. 1447- Types and record constructors can now be aliased with an uppercase name when 1448 imported. Aliasing them with a lowercase name is no longer permitted. 1449- Fixed a bug where nested import paths could be rendered incorrectly in 1450 JavaScript. 1451 1452## v0.16.0 - 2021-06-17 1453 1454[Release Blog Post](https://gleam.run/news/gleam-v0.16-released/) 1455 1456## v0.16.0-rc4 - 2021-06-17 1457 1458- Fixed a bug where if a JavaScript global function was imported as an external 1459 function with the same name the generated code would diverge. 1460 1461## v0.16.0-rc3 - 2021-06-17 1462 1463- New projects are generated using `gleam_stdlib` v0.16.0. 1464 1465## v0.16.0-rc2 - 2021-06-08 1466 1467- Gleam now supports alternative patterns in case expressions for the JavaScript target. 1468- The `gleam` prelude module can now be imported when compiling to JavaScript. 1469- Fixed a bug where the prelude module could not be imported when using the old 1470 build compiler API. 1471- Fixed a bug where if a JavaScript global function was imported as an external 1472 function with the same name the generated code would diverge. 1473- Type error messages coming from pipe usage have been improved. 1474 1475## v0.16.0-rc1 - 2021-06-04 1476 1477- Gleam can now compile to JavaScript! Specify the `--target javascript` flag to 1478 `gleam compile-package` to use it today. 1479- A compile time error is now raised when multiple module level constants with 1480 the same name are defined. 1481- Fixed a bug where declaring a type constructor using reserved erlang keyword 1482 in its fields results in invalid erlang code being generated. 1483- Fixed a bug where calling a function with discarded labelled arguments 1484 incorrectly results in a compile error. 1485- Fixed a bug where assert statements return the wrong value. 1486- The `gleam new` command requires a root folder param, project name is 1487 optional and if not provided the project name will be inferred from 1488 the folder name. 1489- Generated Erlang record header files now contain Erlang type information. 1490- New OTP application projects depend on `gleam_otp` v0.1.5. 1491- The output of the formatter has been improved. 1492 1493## v0.15.1 - 2021-05-07 1494 1495- Fixed a bug where blocks that contained try expressions could be formatted 1496 incorrectly. 1497 1498## v0.15.0 - 2021-05-06 1499 1500[Release Blog Post](https://gleam.run/news/gleam-v0.15-released/) 1501 1502## v0.15.0-rc1 - 2021-05-05 1503 1504- Syntax highlighting of Gleam code in generated HTML documentation has been 1505 improved. 1506- Fixed a bug where markdown tables in rendered HTML documentation would have 1507 the incorrect background colour on every other row. 1508- Tuples now have a new, concise syntax variant: `#(x, y, ...)`. Existing code 1509 can be auto-migrated to the new syntax by running `gleam format`. 1510- Fixed a bug where customt type constructors with Erlang keywords as names 1511 would generate invalid Erlang code. 1512- Gleam now supports `\e` string escapes. 1513- Values and types from the prelude can now be used in a qualified fashion by 1514 importing the `gleam` module. 1515- Empty lists can now be used in constants. 1516- Compiler performance has been improved when working with lists. 1517- Compiler performance has been improved when working with sequences of 1518 expressions. 1519- Assignments using `let` and `assert` are now expressions and no longer require 1520 a following expression in their containing block. They are now themselves 1521 expressions. 1522- Fixed a bug where tuple indexing could incorrectly claim a tuple is not of 1523 type tuple in some circumstances. 1524- Glean `new` command now checks if target folder exists, if so it returns 1525 an error. 1526- A compile time error is now raised if a module is defined with the name `gleam`. 1527- A compile time error is now raised if a module is defined with the a keyword 1528 in the name. 1529- New projects are generated using `gleam_stdlib` v0.15.0. 1530- New projects are generated at v0.1.0. 1531 1532## v0.14.4 - 2021-03-27 1533 1534- The Gleam compiler has been updated to compile with the new Rust v1.51.0. 1535- New project's `gleam.toml` has a comment that shows how to add a 1536 `repository` field. 1537- New projects no longer include a licence field in `src/$APP.app.src` by 1538 default. 1539 1540## v0.14.3 - 2021-03-20 1541 1542- Added an error hint when joining string using the `+` or `+.` operator. 1543- New projects are created with `setup-erlang` v1.1.2 and Erlang/OTP v23.2. 1544- Fixed a bug where the compiler would be unable to locate an imported module 1545 if a value from a nested module is used in a qualified fashion. 1546 1547## v0.14.2 - 2021-03-02 1548 1549- Project names can now contain numbers. 1550 1551## v0.14.1 - 2021-02-27 1552 1553- The error message for binary operators has been given more detail and 1554 hints. 1555- Fixed a bug where alternative patterns would incorrectly report unused 1556 variables. 1557- Fixed a bug where private types shadowed shadowed by values would 1558 incorrectly report unused variables. 1559 1560## v0.14.0 - 2021-02-18 1561 1562[Release Blog Post](https://gleam.run/news/gleam-v0.14-released/) 1563 1564## v0.14.0-rc2 - 2021-02-18 1565 1566- New projects are created with `gleam_stdlib` v0.14.0. 1567 1568## v0.14.0-rc1 - 2021-02-14 1569 1570- Gleam now generates Erlang typespecs. 1571- New projects no longer include a licence file by default. 1572- New projects can be created using the new `escript` template to generate a 1573 command line tool style program. 1574- A warning is emitted when a literal value is constructed but not used. 1575- Automatically generate a link to repository in docs if available. 1576- Code in HTML documentation is has highlighted syntax. 1577- Gleam now only supports `\r`, `\n`, `\t`, `\"`, and `\\` string escapes. 1578- A set of OCI container images are built automatically for each release. 1579- New compile time checks for invalid bit string literals and patterns have 1580 been added. 1581- The error messages for syntax errors in names have been improved. 1582- Fixed a bug where the repo URL would render incorrectly in HTML docs. 1583- Fixed a bug where piping a block can render invalid Erlang. 1584- New compile time warnings on unused types, functions and variables. 1585- The runtime error emitted by the `todo` keyword now carries additional 1586 information. 1587- The runtime error emitted by the `assert` keyword now carries additional 1588 information. 1589- Fixed a bug where bit string patterns would not correctly unify with the 1590 subject being pattern matches on. 1591- Documentation dark mode. 1592- Fixed a bug where some app.src properties were incorrectly named. 1593- `--warnings-as-errors` flag added to `gleam build` command. 1594 1595## v0.13.2 - 2021-01-14 1596 1597- `ring` dep upgraded to enable compilation on Apple M1 ARM processors. 1598 1599## v0.13.1 - 2021-01-13 1600 1601- Fix off-by-one error in message messages. 1602 1603## v0.13.0 - 2021-01-13 1604 1605[Release Blog Post](https://gleam.run/news/gleam-v0.13-released/) 1606 1607- New Gleam projects use stdlib v0.13.0. 1608 1609## v0.13.0-rc2 - 2021-01-12 1610 1611- The `version` property in `gleam.toml` is now optional again. 1612 1613## v0.13.0-rc1 - 2021-01-09 1614 1615- Variable names now only have 1st letter capitalized when converted to erlang. 1616- Records defined in other modules can now be used in module constants. 1617- Documentation can link from functions, types & constants to their source 1618 code definitions on popular project hosting sites. 1619- Documentation hosted on HexDocs now has a version selector. 1620- Fixed a bug where the `app` project template rendered invalid code. 1621- Newly generated projects use stdlib v0.12.0. 1622- Named subexpressions in patterns now render correct Erlang. 1623- The anonymous function syntax now successfully parses with whitespace 1624 between `fn` and `(`. 1625- Fixed a bug where the formatter would incorrectly remove blocks around some 1626 binary operators. 1627- Constants can now be defined after they are used in functions 1628- The parser has been rewritten from scratch, dramatically improving error 1629 messages and compilation times. 1630- `1-1` and `a-1` are now parsed as `1 - 1` and `a - 1` 1631- Further information has been added to the error messages when a function 1632 returns the wrong type. 1633- Further information has been added to the error messages when case clauses 1634 return different types. 1635- Fixed a bug where imported record constructors without labels used as an 1636 anonymous function generates incorrect Erlang. 1637 1638## v0.12.1 - 2020-11-15 1639 1640- The compiler can now discriminate between record access and module access 1641 for shadowed names 1642- The `new` command will no longer permit projects to be made with names that 1643 clash with Erlang standard library modules. 1644- The formatter now correctly treats lines of only whitespace as empty. 1645- The styling of tables in rendered HTML documentation has been improved. 1646- Rendered HTML documentation has regained its max-width styling. 1647 1648## v0.12.0 - 2020-10-31 1649 1650[Release Blog Post](https://gleam.run/news/gleam-v0.12-and-gleam-otp-v0.1-released/) 1651 1652## v0.12.0-rc4 - 2020-10-31 1653 1654- The rendered module documentation sidebar can now scroll independently to 1655 the page. 1656- Application projects now have the correct `mod` value in the generated 1657 `.app.src`. 1658- Records without fields can now be used in module constants. 1659- New application projects are now created used Gleam's type safe OTP pulled 1660 from Hex. 1661 1662## v0.12.0-rc3 - 2020-10-24 1663 1664## v0.12.0-rc2 - 2020-10-24 1665 1666## v0.12.0-rc1 - 2020-10-24 1667 1668- The utf8, utf16, and utf32 type specifiers are now only available in bit 1669 string construction, matching must be done with the codepoint versions. 1670- Functions may now be called before they are defined in a module. This 1671 enabled mutually recursive functions! 1672- Discarded variable names may now include numbers. 1673- Fixed a bug where discarded variables might generate incorrect Erlang. 1674- Added support tuple access in clause guards. 1675- New projects are created with version 1.0.2 of the setup-gleam GitHub 1676 action. 1677- New application projects are now created used Gleam's type safe OTP. 1678- Comments are now correctly handled on platforms that use \r\n line endings, 1679 such as Windows. 1680 1681## v0.11.2 - 2020-09-01 1682 1683- Fixed a bug where an imported constructor would emit an unused constructor 1684 warning when only used in pattern matching. 1685 1686## v0.11.1 - 2020-08-31 1687 1688- The formatter style has been improved to render function type arguments on 1689 a single line when possible, even if the return type will not fit on a 1690 single line. 1691- The format for printed types in error messages has been improved. 1692- Fixed a bug where the formatter would strip a constructor pattern spread 1693 when no fields are given. 1694- Fixed a bug where assigning the result of a block to a variable would 1695 generate incorrect Erlang. 1696- The formatter style has been improved for function calls that take a single 1697 block as an argument. 1698- Reserved words are no longer incorrectly permitted as project names. 1699 1700## v0.11.0 - 2020-08-28 1701 1702[Release Blog Post](https://lpil.uk/blog/gleam-v0.11-released/) 1703 1704## v0.11.0-rc3 - 2020-08-27 1705 1706- Bit strings now support non-literal strings as segment values. 1707- Fixed a bug where Erlang variables could be generated with incorrect names 1708 when defining an anonymous function. 1709 1710## v0.11.0-rc2 - 2020-08-24 1711 1712- The formatter style has been improved to render some single argument calls 1713 in a more compact style. 1714 1715## v0.11.0-rc1 - 2020-08-22 1716 1717- Field access now works before the custom type is defined. 1718- The error message returned by the compiler when the user tries to use unknown 1719 labelled arguments now handles multiple labels at once, and does not suggest 1720 labels they have already supplied. 1721- The formatter style has been improved to use a trailing comma on imports 1722 broken over multiple lines. 1723- The formatter style has been improved to wrap lists and bit strings over as 1724 few lines as possible if the elements are Ints, Floats, or Strings. 1725- The formatter style has been improved to preserve comments on labelled 1726 call arguments. 1727- The formatter style has been improved to preserve empty lines in assignments. 1728- The performance of the formatter has been improved. 1729- Records can be updated using the spread syntax. A warning is emitted if no 1730 fields are updated when using this syntax. 1731- Fixed a bug where type parameters can leak between different type 1732 definitions in a module. 1733- Markdown tables, footnotes, strikethroughs, and tasklists are now supported 1734 in documentation. 1735- Fixed a bug where generic types may be incorrectly unified. 1736- Ints and floats can now be written with underscores for clarity. 1737- The warning for a `todo` now includes the required type of the 1738 not-yet-implemented expression. 1739- Holes can be used in type annotations to specify part of a type, leaving the 1740 rest for inference. 1741- The incorrect arity error now prints any missing labelled arguments. 1742- Fixed a bug where Erlang variables could be generated with incorrect names 1743 when directly calling an anonymous function. 1744- A warning is emitted when a type is imported or created but not used. 1745- Fixed a bug where Erlang variables names could clash when rebinding 1746 variables while similarly named variables ending in a number are in scope. 1747- Fixed a bug in the pretty printer which prevented the formatter from 1748 rendering sub-expressions in a single line when later code would not fit on 1749 the same line. 1750- The formatter style has been improved to render some single argument calls 1751 in a more compact style. 1752- Gleam now supports hex, octal, and binary literals. 1753- Rebar3 hex packages now include `gleam.toml` and `gen`. 1754- Newly generated projects use stdlib v0.11.0. 1755 1756## v0.10.1 - 2020-07-15 1757 1758- Fixed a bug where the compiler failed to return an error when type checking 1759 a tuple with the wrong arity in a pattern. 1760- The error message for a duplicate module member now shows the location of 1761 both definitions. 1762- Fix compiler bug where labelled arguments were being reordered incorrectly. 1763 1764## v0.10.0 - 2020-07-01 1765 1766[Release Blog Post](https://lpil.uk/blog/gleam-v0.10-released/) 1767 1768- Newly generated projects use stdlib v0.10.1. 1769- Fixed a bug where discards inside bit string patterns generated invalid 1770 code. 1771 1772## v0.10.0-rc2 - 2020-06-30 1773 1774- Fixed a bug where variables names would be incorrectly generated when using 1775 alternative patterns. 1776 1777## v0.10.0-rc1 - 2020-06-29 1778 1779- Single letter module names are now permitted. 1780- Added support for bit string syntax. 1781- Support for the deprecated list prepend syntax has been removed. 1782- Added module level constants that are inlined at compile time. 1783- Public module level constants generate documentation. 1784- The formatter style has been improved to wrap and sort imports. 1785- The formatter now permits comments at the end of module function bodies. 1786- The formatter now skips files that match patterns defined in ignore files 1787 such as .gitignore and .ignore. 1788- Error message diagnostic code previews for type errors when using the the 1789 pipe operator have been made more accurate. 1790- Added support for list literals in clause guards. 1791- Fixed bug when reassigning a variable inside a case clause with alternative 1792 patterns. 1793- Todos can now take an optional label. 1794 1795## v0.9.1 - 2020-06-12 1796 1797- Fixed a bug where binary operators may lose required `{ }`s when formatted. 1798 1799## v0.9.0 - 2020-06-01 1800 1801[Release Blog Post](https://lpil.uk/blog/gleam-v0.9-released/) 1802 1803- Newly generated projects use stdlib v0.9.0. 1804- Additional information is printed to the console when generating HTML 1805 documentation from Gleam code. 1806- Fixed a bug where blocks on either side of a binary operator would be 1807 rendered without `{ }`. 1808 1809## v0.9.0-rc1 - 2020-05-26 1810 1811- The formatter style has been improved. 1812- Numbers are now permitted in module names. 1813- Emitted Erlang code correctly adds parentheses around binary subexpressions 1814 to preserve precedence. 1815- Record names and fields are now escaped in `.hrl` files if they conflict 1816 with Erlang reserved words 1817- Annotations are now supported on `let` and `assert` expressions 1818- Formatter now accepts comments for the fields of a custom type's constructors 1819- Added opaque custom types, which have constructors that cannot be accessed 1820 from outside their own modules. 1821- Additional (arbitrary) markdown documentation pages can now be added and 1822 built with `docs build`. 1823- Fix code generation when calling functions returned through either record 1824 or tuple access 1825- Add lookup for Gleam source code in Mix's `deps` directory. 1826- Newly generated Gleam projects use the GitHub action 1827 `gleam-lang/setup-erlang` v1.1.0. 1828- Added support for custom type record literals in guards. 1829- Type variables are now correctly preserved within nested scopes. 1830 1831## v0.8.1 - 2020-05-19 1832 1833- The formatter now correctly handles unicode comments. 1834 1835## v0.8.0 - 2020-05-07 1836 1837[Release Blog Post](https://lpil.uk/blog/gleam-v0.8-released/) 1838 1839- The `docs build`, `docs publish`, and `docs remove` commands can be used to 1840 compile HTML documentation locally, publish them to HexDocs, and remove them 1841 from HexDocs respectively. 1842- Type error reporting has been improved when using the pipe operator. 1843- Newly generated projects use stdlib v0.8.0. 1844- The compiler can now emit warnings. Currently there are warnings for using 1845 the old '|' syntax in lists and for todos. 1846- Will give a clearer error when a function given as an argument to another 1847 function doesn't match the type of the parameter. 1848- Fixed bug where imported type constructors had the incorrect arity. 1849- Fixed bug where a doing an unqualified import of a type constructor and 1850 giving it an alias would use the wrong name if it contained any values. 1851- Fixed a bug trying to access an imported constructor which contained values. 1852- Fixed a compiler crash that occurred when trying to unify a tuple with something 1853 other than another tuple or a variable. 1854- Added support for tuple literals in guards. 1855 1856## v0.8.0-rc1 - 2020-04-28 1857 1858- Strings are now encoded as utf8 binaries in the generated Erlang. 1859- HTML documentation can now be generated from Gleam code by running `gleam build --doc`. 1860- Gleam code can be formatted using the `gleam format` command. 1861- The pipe operator `|>` will now attempt to insert the left hand side as the 1862 first argument to the right hand side if the right hand side is a call, 1863 removing the need for function capture boilerplate. 1864- A `record.label` syntax can now be used to access the fields of a custom 1865 type that have a single record variant. 1866- Anonymous functions can now have return type annotations. 1867- There is a `todo` keyword for type checking functions that have not yet been 1868 implemented. 1869- Tuples can be indexed into using the `var.1` syntax. 1870- `>`, `>=`, `<`, and `<=` operators are now supported in case clause guards 1871 and can be used to check the ordering of integers. 1872- `>.`, `>=.`, `<.`, and `<=.` operators are now supported in case clause 1873 guards and can be used to check the ordering of floats. 1874- The list prepend syntax is now `[x, ..y]`. The old `[x | y]` syntax is 1875 deprecated but will continue to work for now. The formatter will rewrite the 1876 old syntax to the new. 1877- Add new assert syntax for binding variables `assert Ok(x) = result`. In the 1878 future this will allow you to use a pattern that does not match all values. 1879- Added support for int and float literals in guards. 1880- Color codes are now only emitted in error output for interactive terminal 1881 sessions. 1882- Added a new `..` syntax for discarding the remaining fields of a record. 1883- Using the same variable name multiple times in the same pattern will now 1884 raise an error. 1885- Discard can now be omitted in list tails in patterns, ie `[x, ..]` is the 1886 same as `[x, .._]`. The former is the preferred version and is emitted by the 1887 formatter. 1888 1889## v0.7.1 - 2020-03-03 1890 1891- Projects generated with `gleam new` use `stdlib` version 0.7.0. 1892 1893## v0.7.0 - 2020-03-01 1894 1895[Release Blog Post](https://lpil.uk/blog/gleam-v0.7-released/) 1896 1897## v0.7.0-rc1 - 2020-02-28 1898 1899- Type aliases can be defined to give concise names to frequently used types. 1900- Case expression clauses may have guards which can be used to require 1901 equality between specified variables in order for the clause to match. 1902- Case expression clauses may have alternative patterns, enabling one clause 1903 to match for multiple different possible patterns. 1904- Types may now be used before they are defined within their defining module. 1905- Fixed a bug where import paths would not be correctly resolved on Windows. 1906- Added job to create precompiled binary for 64-bit Windows when releasing. 1907- `gleam new` now creates a project that uses `actions/checkout@v2.0.0` in its 1908 GitHub actions workflow. 1909- Labelled argument in functions may now be discarded by prefixing the name 1910 with an underscore, like unlabelled arguments. 1911- Sub-patterns can have names assigned to them within a pattern using the `as` 1912 keyword. 1913- The format of compiler error messages printed to the console has been 1914 improved by upgrading to a newer version of the codespan-reporting library. 1915- Type variables in the given and expected types will now be printed with the 1916 same name in type error messages if they are equivalent. 1917- A friendly error message is rendered when a case expression clause has the 1918 incorrect number of patterns for the subjects. 1919- A friendly error message is rendered when a .gleam file cannot be read. 1920- A friendly error message is rendered when the `gleam new` command fails to 1921 write the new project to the file system. 1922- A friendly error message is rendered when there is a cycle formed by module 1923 imports. 1924- Top level types are now printed in error messages for type parameter mismatches. 1925- The `gen` directory is now deleted before each compilation. 1926- `gleam new` now includes installation instructions for Hex packages in the 1927 generated README. 1928- `gleam new` now accepts a `--description` flag for including a description of 1929 the project in the README and `.app.src` file. 1930- Fixed a bug where variable names would be incorrectly generated in some 1931 situations when variable names are reused during and after a case 1932 expression. 1933- Performance of the Erlang code generator has been improved by removing some 1934 vector allocations. 1935- An error is emitted when multiple types with the same name are defined in or 1936 imported into a module. 1937 1938## v0.6.0 - 2019-12-25 🎄 1939 1940[Release Blog Post](https://lpil.uk/blog/gleam-v0.6-released/) 1941 1942- Function capture syntax now supports labelled arguments. 1943 1944## v0.6.0-rc1 - 2019-12-23 1945 1946- Syntax for defining structs and enums have been unified into a singular 1947 custom type definition statement. Instances of these custom types are called 1948 records. 1949- Anonymous structs have been renamed tuples. 1950- Values and types can be given a new name when imported in the unqualified 1951 fashion using the `import mod.{value as name}` syntax. 1952- An error will be emitted if multiple values constructors are defined with 1953 the same name in a module. 1954 1955## v0.5.1 - 2019-12-23 1956 1957- Fixed a bug where invalid Erlang would be generated when using a local 1958 private function as a value. 1959 1960## v0.5.0 - 2019-12-16 1961 1962[Release Blog Post](https://lpil.uk/blog/gleam-v0.5-released/) 1963 1964- Enum constructor arguments can now be labelled, allowing arguments to be 1965 given by name at the call site. 1966- An Erlang header file with a record definition is generated for each Gleam 1967 struct defined. 1968- `gleam new` creates a project at v1.0.0. 1969- Function calls are now properly escaped when the function name conflicts 1970 with an Erlang keyword. 1971- References to unqualified imported functions now generate correct Erlang 1972 code. 1973- Fixed a bug where variable rebinding would generate incorrect code in some 1974 case expressions. 1975- Fixed a bug where variable rebinding of function arguments would generate 1976 incorrect code. 1977 1978## v0.5.0-rc1 - 2019-11-26 1979 1980- Function arguments can be labelled, allowing arguments to be given by name 1981 at the call site. 1982- `case` expressions now accept multiple subjects, enabling pattern matching 1983 on multiple values simultaneously. 1984- Values and types can be imported from modules and references in an 1985 unqualified fashion. 1986- Named structs now have their name as the first element in the generated 1987 Erlang code. This enabled easier use from Erlang by defining records for 1988 them, as well as slightly clearer printf debugging. 1989- Anonymous structs have been introduced, serving as a quick and generic 1990 alternative to declared structs and as a format for interop with Erlang 1991 tuples. 1992- `gleam new` now accepts a `--template` flag to generate different styles of 1993 project. An OTP application template has been added alongside the existing 1994 OTP library template. 1995- `gleam new` now creates configuration for GitHub Actions, making Gleam 1996 projects ready for continuous integration out of the box. 1997- The syntax for defining enums, case expressions, and blocks has been changed 1998 to a syntax closer to that found in the C family of languages. 1999- The source code preview for functions that return a type incompatible with 2000 the functions annotations has been improved to be more precise. 2001- A helpful error message is rendered if an enum field contains a generic type 2002 that has not been declared. 2003- A bug has been fixed in which type mismatch errors originating from pattern 2004 matching would sometimes display the incorrect expected type. 2005 2006## v0.4.2 - 2019-10-22 2007 2008- Fixed a crash when an incorrect number of labelled struct arguments are 2009 given. 2010- Fixed a struct labelled argument being incorrect reported as already given. 2011 2012## v0.4.1 - 2019-09-29 2013 2014- Struct types with parameterised fields are now registered with the correct 2015 number of type parameters. 2016 2017## v0.4.0 - 2019-09-19 2018 2019[Release Blog Post](https://lpil.uk/blog/gleam-v0.4-released/) 2020 2021- The struct data type has be introduced. Structs are pre-declared user 2022 defined data types with named fields and constant access time. 2023- The map and tuple data types has been removed, replaced by the struct data 2024 type. 2025- The generated code no longer contains export statements if no functions are 2026 exported from a module. 2027- Comparison operators have been specialised to operate only on Ints. 2028- The `>.` `>=.` `<.` and `<=.` comparison operators have been added for 2029 comparing Floats. 2030- It is now an error to export an enum which has a constructor that takes a 2031 private type as an argument. 2032- The error messages for defining multiple modules with the same name and for 2033 importing test modules into application code have been improved. 2034- Numbers are now permitted in type names and constructors. 2035- The `Nil` constructor will no longer erroneously be of type `Int`. 2036 2037## v0.3.0 - 2019-08-08 2038 2039[Release Blog Post](https://lpil.uk/blog/gleam-v0.3-released/) 2040 2041- New project structure can be generated with the `gleam new` command. 2042- Functions can be annotated with their argument and return types. This may be 2043 used to restrict the function to a less general type than inferred by the 2044 compiler, or purely for documentation purposes. 2045- External function names and their target functions are now escaped in the 2046 generated code if they collide with Erlang keywords such as `catch` or `or`. 2047- Type error arising from the arguments of function calls have more accurate 2048 error diagnostics. 2049- Precompiled Gleam binaries are now available on the GitHub release page. 2050- Precompiled Docker images containing the Gleam binary are now available on 2051 DockerHub. 2052- The formatting of the Erlang code rendered by the compiler has been altered 2053 to improve legibility. 2054- A helpful error message is now rendered if the shorthand anonymous function 2055 syntax is used with too many underscores. 2056- A helpful error message is now rendered when attempting to import an unknown 2057 module. 2058 2059## v0.2.0 - 2019-06-25 2060 2061- Modules can now live within namespaces such as `my_app/user/profile`. 2062- The name of the variable created can be specified when importing a module 2063 using the `import my_mod as name` syntax. 2064- Function names and atoms are now escaped in the generated code if they 2065 collide with Erlang keywords such as `catch` or `or`. 2066- There is a shorthand syntax for prepending multiple elements to a list. 2067 `[1, 2, 3 | my_list]` 2068 2069## v0.1.2 - 2019-05-12 2070 2071- Types containing more than 26 type variables will no longer render with 2072 invalid type variable names. 2073- Types in error messages no longer have extra indentation that increases as 2074 the type gets larger. 2075- There is a new type `Nil` which is occupied by a single value (`Nil`). This 2076 type is used to represent the absence of a value and is commonly used with 2077 `Result` to model a value that is either present (`Ok(value)`) or absent 2078 (`Error(Nil)`). 2079- Zero arity enum constructors now generate the correct Erlang when used in 2080 modules other than the one they are defined in. 2081 2082## v0.1.1 - 2019-04-28 2083 2084- Error messages now display the path of the file containing the problem. 2085- Maps and modules with erroneous extra fields now have a custom error 2086 message. 2087- Rows with tails that are unbound type variables are now correctly unified in 2088 the type system. This fixes a bug in which maps and modules may sometimes 2089 fail to type check when there is no error. 2090 2091## v0.1.0 - 2019-04-15 2092 2093[Release Blog Post](https://lpil.uk/blog/hello-gleam/) 2094 2095- Initial release!