diff options
author | Peter <peterhsaxton@gmail.com> | 2020-08-14 08:52:33 +0100 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2020-08-14 11:27:21 +0100 |
commit | 4943602689657203ba763d4f7107f2fd8048c864 (patch) | |
tree | 64ef6348e954cf233345d2add8bf66c43d6ec569 /src | |
parent | fdf7145a92a4be1e9780372b8de5c4770ee06d33 (diff) | |
download | gleam_stdlib-4943602689657203ba763d4f7107f2fd8048c864.tar.gz gleam_stdlib-4943602689657203ba763d4f7107f2fd8048c864.zip |
add docs
Diffstat (limited to 'src')
-rw-r--r-- | src/gleam/list.gleam | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gleam/list.gleam b/src/gleam/list.gleam index c82db2e..456310e 100644 --- a/src/gleam/list.gleam +++ b/src/gleam/list.gleam @@ -630,6 +630,16 @@ fn do_unzip(input, xs, ys) { } } +/// Takes a single list of 2 item tuples and returns two lists. +/// +/// ## Examples +/// +/// > unzip([tuple(1, 2), tuple(3, 4)]) +/// tuple([1, 3], [2, 4]) +/// +/// > unzip([]) +/// tuple([], []) +/// pub fn unzip(input: List(tuple(a, b))) -> tuple(List(a), List(b)) { do_unzip(input, [], []) } |