aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph T. Lyons <JosephTLyons@gmail.com>2024-02-08 02:39:27 -0500
committerLouis Pilfold <louis@lpil.uk>2024-02-08 17:47:02 +0000
commit5bc0aa4c7881b98d49804b80789ed279d944d70e (patch)
treec115db748e901a892e1bc28ac01cc5c1482119dc /src
parentc9f3a84851c5b69b7af23133c10d922109bc7213 (diff)
downloadgleam_stdlib-5bc0aa4c7881b98d49804b80789ed279d944d70e.tar.gz
gleam_stdlib-5bc0aa4c7881b98d49804b80789ed279d944d70e.zip
Remove trailing whitespace
Diffstat (limited to 'src')
-rw-r--r--src/gleam/dict.gleam2
-rw-r--r--src/gleam/dynamic.gleam4
-rw-r--r--src/gleam/function.gleam2
-rw-r--r--src/gleam/iterator.gleam28
-rw-r--r--src/gleam/list.gleam26
-rw-r--r--src/gleam/pair.gleam6
-rw-r--r--src/gleam/result.gleam4
-rw-r--r--src/gleam/string.gleam2
8 files changed, 37 insertions, 37 deletions
diff --git a/src/gleam/dict.gleam b/src/gleam/dict.gleam
index c4a601f..35f5861 100644
--- a/src/gleam/dict.gleam
+++ b/src/gleam/dict.gleam
@@ -494,7 +494,7 @@ fn do_fold(
/// import gleam/string
///
/// let dict = from_list([#("a", 1), #("b", 3), #("c", 9)])
-/// fold(dict, "", fn(accumulator, key, value) {
+/// fold(dict, "", fn(accumulator, key, value) {
/// string.append(accumulator, key)
/// })
/// // -> "abc"
diff --git a/src/gleam/dynamic.gleam b/src/gleam/dynamic.gleam
index f369465..1feadfb 100644
--- a/src/gleam/dynamic.gleam
+++ b/src/gleam/dynamic.gleam
@@ -1022,12 +1022,12 @@ fn decode_map(a: Dynamic) -> Result(Dict(Dynamic, Dynamic), DecodeErrors)
///
/// ```gleam
/// import gleam/result
-///
+///
/// let bool_or_string = any(of: [
/// string,
/// fn(x) { result.map(bool(x), fn(_) { "a bool" }) }
/// ])
-///
+///
/// bool_or_string(from("ok"))
/// // -> Ok("ok")
///
diff --git a/src/gleam/function.gleam b/src/gleam/function.gleam
index 7a438a3..180b6b2 100644
--- a/src/gleam/function.gleam
+++ b/src/gleam/function.gleam
@@ -131,7 +131,7 @@ pub fn tap(arg: a, effect: fn(a) -> b) -> a {
/// let doubler = fn() {
/// fn(x: Int) { x * 2 }
/// }
-///
+///
/// doubler() |> apply1(2)
/// // -> 4
/// ```
diff --git a/src/gleam/iterator.gleam b/src/gleam/iterator.gleam
index 954ee8a..36f2c7b 100644
--- a/src/gleam/iterator.gleam
+++ b/src/gleam/iterator.gleam
@@ -160,7 +160,7 @@ fn do_transform(
/// |> to_list
/// // -> [#(0, "a"), #(1, "b"), #(2, "c")]
/// ```
-///
+///
pub fn transform(
over iterator: Iterator(a),
from initial: acc,
@@ -245,7 +245,7 @@ pub fn to_list(iterator: Iterator(element)) -> List(element) {
///
/// ```gleam
/// let assert Next(first, rest) = from_list([1, 2, 3, 4]) |> step
-///
+///
/// first
/// // -> 1
///
@@ -396,28 +396,28 @@ fn do_map2(
}
/// Combines two interators into a single one using the given function.
-///
+///
/// If an iterator is longer than the other the extra elements are dropped.
-///
+///
/// This function does not evaluate the elements of the two iterators, the
/// computation is performed when the resulting iterator is later run.
-///
+///
/// ## Examples
-///
+///
/// ```gleam
/// let first = from_list([1, 2, 3])
/// let second = from_list([4, 5, 6])
/// map2(first, second, fn(x, y) { x + y }) |> to_list
/// // -> [5, 7, 9]
/// ```
-///
+///
/// ```gleam
/// let first = from_list([1, 2])
/// let second = from_list(["a", "b", "c"])
/// map2(first, second, fn(i, x) { #(i, x) }) |> to_list
/// // -> [#(1, "a"), #(2, "b")]
/// ```
-///
+///
pub fn map2(
iterator1: Iterator(a),
iterator2: Iterator(b),
@@ -1021,14 +1021,14 @@ fn do_intersperse(
/// |> to_list
/// // -> []
/// ```
-///
+///
/// ```gleam
/// from_list([1])
/// |> intersperse(with: 0)
/// |> to_list
/// // -> [1]
/// ```
-///
+///
/// ```gleam
/// from_list([1, 2, 3, 4, 5])
/// |> intersperse(with: 0)
@@ -1516,12 +1516,12 @@ pub fn each(over iterator: Iterator(a), with f: fn(a) -> b) -> Nil {
}
/// Add a new element to the start of an iterator.
-///
+///
/// This function is for use with `use` expressions, to replicate the behaviour
/// of the `yield` keyword found in other languages.
-///
+///
/// ## Examples
-///
+///
/// ```gleam
/// let iterator = {
/// use <- yield(1)
@@ -1532,7 +1532,7 @@ pub fn each(over iterator: Iterator(a), with f: fn(a) -> b) -> Nil {
/// iterator |> to_list
/// // -> [1, 2, 3]
/// ```
-///
+///
pub fn yield(element: a, next: fn() -> Iterator(a)) -> Iterator(a) {
Iterator(fn() { Continue(element, next().continuation) })
}
diff --git a/src/gleam/list.gleam b/src/gleam/list.gleam
index b59e5fd..4cbc71a 100644
--- a/src/gleam/list.gleam
+++ b/src/gleam/list.gleam
@@ -267,7 +267,7 @@ fn update_group(
///
/// ```gleam
/// import gleam/dict
-///
+///
/// [Ok(3), Error("Wrong"), Ok(200), Ok(73)]
/// |> group(by: fn(i) {
/// case i {
@@ -281,7 +281,7 @@ fn update_group(
/// // #("Successful", [Ok(73), Ok(200), Ok(3)])
/// // ]
/// ```
-///
+///
/// ```gleam
/// import gleam/dict
/// group([1,2,3,4,5], by: fn(i) { i - i / 3 * 3 })
@@ -383,21 +383,21 @@ pub fn map(list: List(a), with fun: fn(a) -> b) -> List(b) {
}
/// Combines two lists into a single list using the given function.
-///
+///
/// If a list is longer than the other the extra elements are dropped.
-///
+///
/// ## Examples
-///
+///
/// ```gleam
/// map2([1, 2, 3], [4, 5, 6], fn(x, y) { x + y })
/// // -> [5, 7, 9]
/// ```
-///
+///
/// ```gleam
/// map2([1, 2], ["a", "b", "c"], fn(i, x) { #(i, x) })
/// // -> [#(1, "a"), #(2, "b")]
/// ```
-///
+///
pub fn map2(
list1: List(a),
list2: List(b),
@@ -647,10 +647,10 @@ fn do_append_acc(first: List(a), second: List(a)) -> List(a) {
///
/// ```gleam
/// let existing_list = [2, 3, 4]
-///
+///
/// [1, ..existing_list]
/// // -> [1, 2, 3, 4]
-///
+///
/// prepend(to: existing_list, this: 1)
/// // -> [1, 2, 3, 4]
/// ```
@@ -692,16 +692,16 @@ pub fn concat(lists: List(List(a))) -> List(a) {
/// This is the same as `concat`: it joins a list of lists into a single
/// list.
-///
+///
/// This function traverses all elements twice.
-///
+///
/// ## Examples
-///
+///
/// ```gleam
/// flatten([[1], [2, 3], []])
/// // -> [1, 2, 3]
/// ```
-///
+///
pub fn flatten(lists: List(List(a))) -> List(a) {
do_concat(lists, [])
}
diff --git a/src/gleam/pair.gleam b/src/gleam/pair.gleam
index fb74614..566fc9c 100644
--- a/src/gleam/pair.gleam
+++ b/src/gleam/pair.gleam
@@ -72,14 +72,14 @@ pub fn map_second(of pair: #(a, b), with fun: fn(b) -> c) -> #(a, c) {
/// Returns a new pair with the given elements. This can also be done using the dedicated
/// syntax instead: `new(1, 2) == #(1, 2)`.
-///
+///
/// ## Examples
-///
+///
/// ```gleam
/// new(1, 2)
/// // -> #(1, 2)
/// ```
-///
+///
pub fn new(first: a, second: b) -> #(a, b) {
#(first, second)
}
diff --git a/src/gleam/result.gleam b/src/gleam/result.gleam
index 89d5613..e40b3ad 100644
--- a/src/gleam/result.gleam
+++ b/src/gleam/result.gleam
@@ -368,7 +368,7 @@ pub fn all(results: List(Result(a, e))) -> Result(List(a), e) {
/// Given a list of results, returns a pair where the first element is a list
/// of all the values inside `Ok` and the second element is a list with all the
/// values inside `Error`. The values in both lists appear in reverse order with
-/// respect to their position in the original list of results.
+/// respect to their position in the original list of results.
///
/// ## Examples
///
@@ -450,7 +450,7 @@ pub fn values(results: List(Result(a, e))) -> List(a) {
///
/// If the result is an `Ok` rather than `Error` the function is not called and the
/// result stays the same.
-///
+///
/// This function is useful for chaining together computations that may fail
/// and trying to recover from possible errors.
///
diff --git a/src/gleam/string.gleam b/src/gleam/string.gleam
index 0a165be..da5c394 100644
--- a/src/gleam/string.gleam
+++ b/src/gleam/string.gleam
@@ -905,7 +905,7 @@ fn do_inspect(term term: anything) -> StringBuilder
/// JavaScript.
///
/// ## Examples
-///
+///
/// ```gleam
/// byte_size("🏳️‍⚧️🏳️‍🌈👩🏾‍❤️‍👨🏻")
/// // -> 58