aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gleam/list.gleam8
-rw-r--r--src/gleam/uri.gleam2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/gleam/list.gleam b/src/gleam/list.gleam
index a019653..e4063cd 100644
--- a/src/gleam/list.gleam
+++ b/src/gleam/list.gleam
@@ -163,16 +163,16 @@ pub fn contains(list: List(a), any elem: a) -> Bool {
///
/// ## Examples
///
-/// > head([])
+/// > first([])
/// Error(Nil)
///
-/// > head([0])
+/// > first([0])
/// Ok(0)
///
-/// > head([1, 2])
+/// > first([1, 2])
/// Ok(1)
///
-pub fn head(list: List(a)) -> Result(a, Nil) {
+pub fn first(list: List(a)) -> Result(a, Nil) {
case list {
[] -> Error(Nil)
[x, .._] -> Ok(x)
diff --git a/src/gleam/uri.gleam b/src/gleam/uri.gleam
index 86e0c3a..b1d5ed1 100644
--- a/src/gleam/uri.gleam
+++ b/src/gleam/uri.gleam
@@ -116,7 +116,7 @@ if javascript {
|> regex.compile(regex.Options(case_insensitive: True, multi_line: False))
|> result.nil_error
|> result.map(regex.scan(_, string))
- |> result.then(list.head)
+ |> result.then(list.first)
|> result.map(fn(m: regex.Match) { m.submatches })
|> result.unwrap([])
}