Skip to content

Commit b1e931e

Browse files
committed
std: Updated examples in the doc comments
1 parent fb101ac commit b1e931e

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

std/applicative/app.pics

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Applicative :: module {
1515
//
1616
// Example:
1717
// --- Code
18-
// apply(Result.ok(|x| -> x + 1), Result.ok(2)) == Result.ok(3)
18+
// apply(Result::ok(|x| -> x + 1), Result::ok(2)) == Result::ok(3)
1919
// ---
2020
apply :: (mf, ma) =
2121
when mf {
@@ -33,7 +33,7 @@ Applicative :: module {
3333
//
3434
// Example:
3535
// --- Code
36-
// map2(Result.ok(2), Result.ok(3), |a, b| -> a + b) == Result.ok(5)
36+
// map2(Result::ok(2), Result::ok(3), |a, b| -> a + b) == Result::ok(5)
3737
// ---
3838
map2 :: (ma, mb, fx) =
3939
Applicative.apply(Result.ok(|a| -> |b| -> fx(a, b)), ma) |> Applicative.apply(mb)
@@ -44,7 +44,7 @@ Applicative :: module {
4444
//
4545
// Example:
4646
// --- Code
47-
// thenIgnoreLeft(Result.ok(1), Result.ok(2)) == Result.ok(2)
47+
// thenIgnoreLeft(Result::ok(1), Result::ok(2)) == Result::ok(2)
4848
// ---
4949
thenIgnoreLeft :: (fa, fb) =
5050
Applicative.map2(fa, fb, |_, b| -> b)
@@ -54,7 +54,7 @@ Applicative :: module {
5454
// This functions is mostly known as then `<*` operator
5555
// Example:
5656
// --- Code
57-
// thenIgnoreRight(Result.ok(1), Result.ok(2)) == Result.ok(1)
57+
// thenIgnoreRight(Result::ok(1), Result::ok(2)) == Result::ok(1)
5858
// ---
5959
thenIgnoreRight :: (fa, fb) =
6060
Applicative.map2(fa, fb, |a, _| -> a)
@@ -73,7 +73,7 @@ Applicative :: module {
7373
//
7474
// Example:
7575
// --- Code
76-
// lift2(|a, b| -> a + b, Result.ok(1), Result.ok(2)) == Result.ok(3)
76+
// lift2(|a, b| -> a + b, Result::ok(1), Result::ok(2)) == Result::ok(3)
7777
// ---
7878
lift2 :: (fx, a, b) = Applicative.map2(a, b, fx)
7979

@@ -83,7 +83,7 @@ Applicative :: module {
8383
//
8484
// Example:
8585
// --- Code
86-
// sequence([Result.ok(1), Result.ok(2)]) == Result.ok([1, 2])
86+
// sequence([Result::ok(1), Result::ok(2)]) == Result::ok([1, 2])
8787
// ---
8888
sequence :: (results=[]) =
8989
when results {
@@ -98,7 +98,7 @@ Applicative :: module {
9898
//
9999
// Example:
100100
// --- Code
101-
// traverse([1, 2, 3], |x| -> Result.ok(x * 2)) == Result.ok([2, 4, 6])
101+
// traverse([1, 2, 3], |x| -> Result::ok(x * 2)) == Result::ok([2, 4, 6])
102102
// ---
103103
traverse :: (xs=[], fx) =
104104
when xs {

std/sys/sys.pics

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ System :: module {
1717
// Behavior:
1818
// Immediately stops the program and raises an unrecoverable error.
1919
//
20-
// Usage:
20+
// Example:
21+
// --- Code
2122
// System::panic("Something went horribly wrong")
23+
// ---
2224
panic :: (message="") = pic_nat_panic(message)
2325

2426

@@ -31,8 +33,10 @@ System :: module {
3133
// Behavior:
3234
// Panics at runtime to indicate that this code hasn’t been written yet.
3335
//
34-
// Usage:
36+
// Example:
37+
// --- Code
3538
// System::todo("Finish the file upload logic here")
39+
// ---
3640
todo :: (message="") = pic_nat_todo(message)
3741

3842

@@ -45,8 +49,10 @@ System :: module {
4549
// Behavior:
4650
// Panics at runtime to indicate an internal logic error or failed exhaustiveness.
4751
//
48-
// Usage:
52+
// Example:
53+
// --- Code
4954
// System::unreachable("Should never hit this case")
55+
// ---
5056
unreachable :: (message="") = pic_nat_unreachable(message)
5157

5258
}

0 commit comments

Comments
 (0)