From c46f76f16ead267506629093a988861accf00721 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Mon, 13 Jan 2020 22:35:30 +0000 Subject: Type annotations for gleam/pair --- src/gleam/pair.gleam | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') 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)) } -- cgit v1.2.3