diff options
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | src/gleam/function.gleam | 31 |
2 files changed, 4 insertions, 29 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index eabd6d1..4465cda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -- The `function.curry*` functions have been deprecated. +- The `function.curry*` and `function.apply*` functions have been deprecated. - The deprecated `dynamic.unsafe_coerce` function has been removed. - The deprecated `dict.update` function has been removed. - The deprecated `order.max` and `order.min` functions have been removed. diff --git a/src/gleam/function.gleam b/src/gleam/function.gleam index 1178f1e..824f373 100644 --- a/src/gleam/function.gleam +++ b/src/gleam/function.gleam @@ -58,42 +58,17 @@ pub fn tap(arg: a, effect: fn(a) -> b) -> a { arg } -/// Takes a function with arity one and an argument, -/// calls that function with the argument and returns the function return value. -/// -/// Useful for concisely calling functions returned as a part of a pipeline. -/// -/// ## Example -/// -/// ```gleam -/// let doubler = fn() { -/// fn(x: Int) { x * 2 } -/// } -/// -/// doubler() |> apply1(2) -/// // -> 4 -/// ``` -/// +@deprecated("Use a fn literal instead, it is easier to understand") pub fn apply1(fun: fn(a) -> value, arg1: a) -> value { fun(arg1) } -/// Takes a function with arity two and two arguments, -/// calls that function with the arguments -/// and returns the function return value. -/// -/// See [`apply1`](#apply1) for more details. -/// +@deprecated("Use a fn literal instead, it is easier to understand") pub fn apply2(fun: fn(a, b) -> value, arg1: a, arg2: b) -> value { fun(arg1, arg2) } -/// Takes a function with arity three and three arguments, -/// calls that function with the arguments -/// and returns the function return value. -/// -/// See [`apply1`](#apply1) for more details. -/// +@deprecated("Use a fn literal instead, it is easier to understand") pub fn apply3(fun: fn(a, b, c) -> value, arg1: a, arg2: b, arg3: c) -> value { fun(arg1, arg2, arg3) } |