diff options
-rw-r--r-- | src/gleam/pair.gleam | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gleam/pair.gleam b/src/gleam/pair.gleam index 1637034..4cbce53 100644 --- a/src/gleam/pair.gleam +++ b/src/gleam/pair.gleam @@ -1,24 +1,24 @@ -pub fn first(pair) { +pub fn first(pair: tuple(a, b)) -> a { let tuple(a, _) = pair a } -pub fn second(pair) { +pub fn second(pair: tuple(a, b)) -> b { let tuple(_, a) = pair a } -pub fn swap(pair) { +pub fn swap(pair: tuple(a, b)) -> tuple(b, a) { let tuple(a, b) = pair tuple(b, a) } -pub fn map_first(of pair, with fun) { +pub fn map_first(of pair: tuple(a, b), with fun: fn(a) -> c) -> tuple(c, b) { let tuple(a, b) = pair tuple(fun(a), b) } -pub fn map_second(of pair, with fun) { +pub fn map_second(of pair: tuple(a, b), with fun: fn(b) -> c) -> tuple(a, c) { let tuple(a, b) = pair tuple(a, fun(b)) } |