aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGiacomo Cavalieri <giacomo.cavalieri@icloud.com>2023-12-31 22:20:17 +0100
committerLouis Pilfold <louis@lpil.uk>2024-01-02 17:08:28 +0000
commite16afedefaf777fd29e2868092c63f4f32c535d5 (patch)
tree9b3d48bd035ca86c85b2178dddb0594724cafa0f /src
parentda08d59a184f22891d55a29458fd1f59c0b4d91e (diff)
downloadgleam_stdlib-e16afedefaf777fd29e2868092c63f4f32c535d5.tar.gz
gleam_stdlib-e16afedefaf777fd29e2868092c63f4f32c535d5.zip
pair doc examples
Diffstat (limited to 'src')
-rw-r--r--src/gleam/pair.gleam24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/gleam/pair.gleam b/src/gleam/pair.gleam
index 894e6a8..fb74614 100644
--- a/src/gleam/pair.gleam
+++ b/src/gleam/pair.gleam
@@ -3,8 +3,8 @@
/// ## Examples
///
/// ```gleam
-/// > first(#(1, 2))
-/// 1
+/// first(#(1, 2))
+/// // -> 1
/// ```
///
pub fn first(pair: #(a, b)) -> a {
@@ -17,8 +17,8 @@ pub fn first(pair: #(a, b)) -> a {
/// ## Examples
///
/// ```gleam
-/// > second(#(1, 2))
-/// 2
+/// second(#(1, 2))
+/// // -> 2
/// ```
///
pub fn second(pair: #(a, b)) -> b {
@@ -31,8 +31,8 @@ pub fn second(pair: #(a, b)) -> b {
/// ## Examples
///
/// ```gleam
-/// > swap(#(1, 2))
-/// #(2, 1)
+/// swap(#(1, 2))
+/// // -> #(2, 1)
/// ```
///
pub fn swap(pair: #(a, b)) -> #(b, a) {
@@ -46,8 +46,8 @@ pub fn swap(pair: #(a, b)) -> #(b, a) {
/// ## Examples
///
/// ```gleam
-/// > #(1, 2) |> map_first(fn(n) { n * 2 })
-/// #(2, 2)
+/// #(1, 2) |> map_first(fn(n) { n * 2 })
+/// // -> #(2, 2)
/// ```
///
pub fn map_first(of pair: #(a, b), with fun: fn(a) -> c) -> #(c, b) {
@@ -61,8 +61,8 @@ pub fn map_first(of pair: #(a, b), with fun: fn(a) -> c) -> #(c, b) {
/// ## Examples
///
/// ```gleam
-/// > #(1, 2) |> map_second(fn(n) { n * 2 })
-/// #(1, 4)
+/// #(1, 2) |> map_second(fn(n) { n * 2 })
+/// // -> #(1, 4)
/// ```
///
pub fn map_second(of pair: #(a, b), with fun: fn(b) -> c) -> #(a, c) {
@@ -76,8 +76,8 @@ pub fn map_second(of pair: #(a, b), with fun: fn(b) -> c) -> #(a, c) {
/// ## Examples
///
/// ```gleam
-/// > new(1, 2)
-/// #(1, 2)
+/// new(1, 2)
+/// // -> #(1, 2)
/// ```
///
pub fn new(first: a, second: b) -> #(a, b) {