From c6f44a90f96b56bd67b122e7589d670f30ab636d Mon Sep 17 00:00:00 2001 From: Giacomo Cavalieri Date: Tue, 5 Nov 2024 15:23:17 +0100 Subject: [PATCH] CHANGELOG! --- CHANGELOG.md | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0792b024c58..c5382a89ebc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,13 +39,61 @@ aren't located at the root of their repository: ```toml - repository = { type = "github", user = "gleam-lang", repo = "gleam", path = "packages/my_package" } + repository = { + type = "github", + user = "gleam-lang", + repo = "gleam", + path = "packages/my_package" + } ``` ([Richard Viney](https://github.com/richard-viney)) +- The build tool now refuses to publish any incomplete package that has any + `echo` debug printing left. + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + ### Compiler +- You can now use the `echo` keyword to debug print any value: `echo` can be + followed by any expression and it will print it to stderr alongside the module + it comes from and its line number. This: + + ```gleam + pub fn main() { + echo [1, 2, 3] + } + ``` + + Will output to stderr: + + ```txt + /src/module.gleam:2 + [1, 2, 3] + ``` + + `echo` can also be used in the middle of a pipeline. This: + + ```gleam + pub fn main() { + [1, 2, 3] + |> echo + |> list.map(fn(x) { x * 2 }) + |> echo + } + ``` + + Will output to stderr: + + ```txt + /src/module.gleam:3 + [1, 2, 3] + /src/module.gleam:5 + [2, 4, 6] + ``` + + ([Giacomo Cavalieri](https://github.com/giacomocavalieri)) + - The compiler now prints correctly qualified or aliased type names when printing type errors.