diff options
author | Giacomo Cavalieri <giacomo.cavalieri@icloud.com> | 2023-05-25 17:09:37 +0200 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2023-05-25 16:35:25 +0100 |
commit | 22910e44979f3530a2ef6fd791f2214697e0a659 (patch) | |
tree | 1a04d7fc8d564e211200cabbb699cae8c45cb614 | |
parent | 785398d47294caeb74aaf5030c12b880e324dc5a (diff) | |
download | gleam_stdlib-22910e44979f3530a2ef6fd791f2214697e0a659.tar.gz gleam_stdlib-22910e44979f3530a2ef6fd791f2214697e0a659.zip |
Replace occurrences of `list.head` in comments in favour of `list.first`
-rw-r--r-- | src/gleam/iterator.gleam | 6 | ||||
-rw-r--r-- | src/gleam/list.gleam | 16 | ||||
-rw-r--r-- | src/gleam/queue.gleam | 4 | ||||
-rw-r--r-- | test/gleam/function_test.gleam | 2 |
4 files changed, 14 insertions, 14 deletions
diff --git a/src/gleam/iterator.gleam b/src/gleam/iterator.gleam index b583d01..4e5a752 100644 --- a/src/gleam/iterator.gleam +++ b/src/gleam/iterator.gleam @@ -245,15 +245,15 @@ pub fn to_list(iterator: Iterator(element)) -> List(element) { /// ## Examples /// /// ```gleam -/// > let assert Next(head, tail) = [1, 2, 3, 4] +/// > let assert Next(first, rest) = [1, 2, 3, 4] /// > |> from_list /// > |> step -/// > head +/// > first /// 1 /// ``` /// /// ```gleam -/// > tail |> to_list +/// > rest |> to_list /// [2, 3, 4] /// ``` /// diff --git a/src/gleam/list.gleam b/src/gleam/list.gleam index b7b0186..8d8ddfe 100644 --- a/src/gleam/list.gleam +++ b/src/gleam/list.gleam @@ -480,12 +480,12 @@ fn do_try_map( /// ``` /// /// ```gleam -/// > try_map([[1], [2, 3]], head) +/// > try_map([[1], [2, 3]], first) /// Ok([1, 2]) /// ``` /// /// ```gleam -/// > try_map([[1], [], [2]], head) +/// > try_map([[1], [], [2]], first) /// Error(Nil) /// ``` /// @@ -851,17 +851,17 @@ pub fn find( /// ## Examples /// /// ```gleam -/// > find_map([[], [2], [3]], head) +/// > find_map([[], [2], [3]], first) /// Ok(2) /// ``` /// /// ```gleam -/// > find_map([[], []], head) +/// > find_map([[], []], first) /// Error(Nil) /// ``` /// /// ```gleam -/// > find_map([], head) +/// > find_map([], first) /// Error(Nil) /// ``` /// @@ -1461,17 +1461,17 @@ fn do_pop_map(haystack, mapper, checked) { /// ## Examples /// /// ```gleam -/// > pop_map([[], [2], [3]], head) +/// > pop_map([[], [2], [3]], first) /// Ok(#(2, [[], [3]])) /// ``` /// /// ```gleam -/// > pop_map([[], []], head) +/// > pop_map([[], []], first) /// Error(Nil) /// ``` /// /// ```gleam -/// > pop_map([], head) +/// > pop_map([], first) /// Error(Nil) /// ``` /// diff --git a/src/gleam/queue.gleam b/src/gleam/queue.gleam index 5570156..5bf60c8 100644 --- a/src/gleam/queue.gleam +++ b/src/gleam/queue.gleam @@ -24,7 +24,7 @@ pub fn new() -> Queue(a) { } /// Converts a list of elements into a queue of the same elements in the same -/// order. The head element in the list becomes the front element in the queue. +/// order. The first element in the list becomes the front element in the queue. /// /// This function runs in constant time. /// @@ -40,7 +40,7 @@ pub fn from_list(list: List(a)) -> Queue(a) { } /// Converts a queue of elements into a list of the same elements in the same -/// order. The front element in the queue becomes the head element in the list. +/// order. The front element in the queue becomes the first element in the list. /// /// This function runs in linear time. /// diff --git a/test/gleam/function_test.gleam b/test/gleam/function_test.gleam index 544b295..26919f2 100644 --- a/test/gleam/function_test.gleam +++ b/test/gleam/function_test.gleam @@ -16,7 +16,7 @@ pub fn compose_test() { |> add_five |> should.equal(6) - // Takes a list of ints and returns the head as a string (if there is one, or + // Takes a list of ints and returns the first as a string (if there is one, or // else "0" if there is not) let first_to_string = list.first |