diff options
author | Louis Pilfold <louis@lpil.uk> | 2020-04-18 22:00:09 +0100 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2020-04-18 22:00:09 +0100 |
commit | 094cf5f6d6f9dac61806f883d3677d357d3a7f38 (patch) | |
tree | 2c8f24841f9d9eec0028793c19005e95ea68fa99 | |
parent | e0cb8e9d9b0f6e733bdce59dfbfdc94d06bfb340 (diff) | |
download | gleam_stdlib-094cf5f6d6f9dac61806f883d3677d357d3a7f38.tar.gz gleam_stdlib-094cf5f6d6f9dac61806f883d3677d357d3a7f38.zip |
Show how to label arguments of external functions
-rw-r--r-- | src/gleam/list.gleam | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gleam/list.gleam b/src/gleam/list.gleam index fbc3ab5..271ef3b 100644 --- a/src/gleam/list.gleam +++ b/src/gleam/list.gleam @@ -12,7 +12,7 @@ pub type LengthMismatch { /// Using the Erlang C BIF implementation. /// -pub external fn length(List(a)) -> Int = "erlang" "length" +pub external fn length(of: List(a)) -> Int = "erlang" "length" /// Using the Erlang C BIF implementation. /// @@ -230,7 +230,7 @@ pub fn zip(xs: List(a), ys: List(b)) -> List(tuple(a, b)) { } pub fn strict_zip(l1: List(a), l2: List(b)) -> Result(List(tuple(a, b)), LengthMismatch) { - case length(l1) == length(l2) { + case length(of: l1) == length(of: l2) { True -> Ok(zip(l1, l2)) False -> Error(LengthMismatch) } |