diff options
author | Louis Pilfold <louis@lpil.uk> | 2020-01-05 18:28:04 +0000 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2020-01-05 18:33:28 +0000 |
commit | 330ea699f3c20519c174c2299215737cef5f4cbf (patch) | |
tree | a4afa9628640ac993a8cbb5eb643b04e13422969 /src | |
parent | debc834f87f3b5df7057dc924f577dd57d0fee8c (diff) | |
download | gleam_stdlib-330ea699f3c20519c174c2299215737cef5f4cbf.tar.gz gleam_stdlib-330ea699f3c20519c174c2299215737cef5f4cbf.zip |
function.identity
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 +} |