diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gleam/function.gleam | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gleam/function.gleam b/src/gleam/function.gleam index 41ccf67..68fc619 100644 --- a/src/gleam/function.gleam +++ b/src/gleam/function.gleam @@ -9,3 +9,8 @@ pub fn compose(fun1: fn(a) -> b, fun2: fn(b) -> c) -> fn(a) -> c { pub fn flip(fun: fn(a, b) -> c) -> fn(b, a) -> c { fn(b, a) { fun(a, b) } } + +// A function that always returns its input value. +pub fn identity(x: a) -> a { + x +} |