diff options
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | src/gleam/function.gleam | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index d7518a7..c16bea4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Fixed a bug where the `string.length` function would cause a JavaScript error for empty strings on older JavaScript runtimes. - The `bool` module gains the `to_string` function. +- The `function` module gains the `tap` function. ## v0.20.0 - 2022-02-22 @@ -64,6 +65,7 @@ - The internal `gleam_stdlib.js` module has been renamed to `gleam_stdlib.mjs`. ## v0.18.0 - 2021-11-23 + ## v0.18.0-rc1 - 2021-11-23 - Converted to use the Gleam build tool, not rebar3. diff --git a/src/gleam/function.gleam b/src/gleam/function.gleam index 1ee8d9c..cda59fc 100644 --- a/src/gleam/function.gleam +++ b/src/gleam/function.gleam @@ -63,7 +63,7 @@ pub fn constant(value: a) -> fn(b) -> a { /// calls that function with that argument /// and returns that argument instead of the function return value. /// Useful for running synchronous side effects in a pipeline. -pub fn tap (arg: a, effect: fn (a) -> b) -> a { +pub fn tap(arg: a, effect: fn(a) -> b) -> a { effect(arg) arg } |