From 22910e44979f3530a2ef6fd791f2214697e0a659 Mon Sep 17 00:00:00 2001 From: Giacomo Cavalieri Date: Thu, 25 May 2023 17:09:37 +0200 Subject: Replace occurrences of `list.head` in comments in favour of `list.first` --- src/gleam/iterator.gleam | 6 +++--- src/gleam/list.gleam | 16 ++++++++-------- src/gleam/queue.gleam | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') 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. /// -- cgit v1.2.3