Skip to content

Commit f42264c

Browse files
authored
chore(docs): Clean up pre 0.6 examples (#2297)
1 parent c423ae7 commit f42264c

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ It can sometimes be helpful to run small Grain programs directly to test some fu
3535

3636
### Standard library
3737

38-
It's usually easiest to create a small Grain program that imports your library to try it out, like so:
38+
It's usually easiest to create a small Grain program that includes your library to try it out, like so:
3939

4040
```grain
41-
import Array from "array"
41+
from "array" include Array
4242
4343
let appended = Array.append([> 1, 2, 3], [> 4, 5, 6])
4444
print(appended)
@@ -47,7 +47,7 @@ print(appended)
4747
The tests for the standard library are located in `compiler/test/stdlib`. Since the standard library tests are written in Grain, rather than running the whole test suite, you can just run them directly:
4848

4949
```bash
50-
grain compiler/test/stdlib/array.test.gr
50+
grain compiler/test/stdlib/array.test.gr --stdlib stdlib
5151
```
5252

5353
If there's no error, you're all set.

stdlib/int32.gr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ let rec expBySquaring = (y, x, n) => {
663663
* @returns The base raised to the given power
664664
*
665665
* @example
666-
* from Int32 use { (**) }
666+
* use Int32.{ (**) }
667667
* assert 2l ** 3l == 8l
668668
*
669669
* @since v0.6.0

stdlib/int32.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ Returns:
11721172
Examples:
11731173

11741174
```grain
1175-
from Int32 use { (**) }
1175+
use Int32.{ (**) }
11761176
assert 2l ** 3l == 8l
11771177
```
11781178

stdlib/int64.gr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ let rec expBySquaring = (y, x, n) => {
654654
* @returns The base raised to the given power
655655
*
656656
* @example
657-
* from Int64 use { (**) }
657+
* use Int64.{ (**) }
658658
* assert 2L ** 3L == 8L
659659
*
660660
* @since v0.6.0

stdlib/int64.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ Returns:
11721172
Examples:
11731173

11741174
```grain
1175-
from Int64 use { (**) }
1175+
use Int64.{ (**) }
11761176
assert 2L ** 3L == 8L
11771177
```
11781178

stdlib/number.gr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ provide let e = 2.718281828459045
8383
* @returns The sum of the two operands
8484
*
8585
* @example
86-
* from Number use { (+) }
86+
* use Number.{ (+) }
8787
* assert 1 + 2 == 3
8888
*
8989
* @since v0.6.0
@@ -99,7 +99,7 @@ provide let (+) = (+)
9999
* @returns The difference of the two operands
100100
*
101101
* @example
102-
* from Number use { (-) }
102+
* use Number.{ (-) }
103103
* assert 5 - 2 == 3
104104
*
105105
* @since v0.6.0
@@ -115,7 +115,7 @@ provide let (-) = (-)
115115
* @returns The product of the two operands
116116
*
117117
* @example
118-
* from Number use { (*) }
118+
* use Number.{ (*) }
119119
* assert 5 * 4 == 20
120120
*
121121
* @since v0.6.0
@@ -131,7 +131,7 @@ provide let (*) = (*)
131131
* @returns The quotient of the two operands
132132
*
133133
* @example
134-
* from Number use { (/) }
134+
* use Number.{ (/) }
135135
* assert 10 / 2.5 == 4
136136
*
137137
* @since v0.6.0
@@ -147,7 +147,7 @@ provide let (/) = (/)
147147
* @returns The base raised to the given power
148148
*
149149
* @example
150-
* from Number use { (**) }
150+
* use Number.{ (**) }
151151
* assert 10 ** 2 == 100
152152
*
153153
* @since v0.6.0

stdlib/number.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Returns:
157157
Examples:
158158

159159
```grain
160-
from Number use { (+) }
160+
use Number.{ (+) }
161161
assert 1 + 2 == 3
162162
```
163163

@@ -197,7 +197,7 @@ Returns:
197197
Examples:
198198

199199
```grain
200-
from Number use { (-) }
200+
use Number.{ (-) }
201201
assert 5 - 2 == 3
202202
```
203203

@@ -237,7 +237,7 @@ Returns:
237237
Examples:
238238

239239
```grain
240-
from Number use { (*) }
240+
use Number.{ (*) }
241241
assert 5 * 4 == 20
242242
```
243243

@@ -277,7 +277,7 @@ Returns:
277277
Examples:
278278

279279
```grain
280-
from Number use { (/) }
280+
use Number.{ (/) }
281281
assert 10 / 2.5 == 4
282282
```
283283

@@ -317,7 +317,7 @@ Returns:
317317
Examples:
318318

319319
```grain
320-
from Number use { (**) }
320+
use Number.{ (**) }
321321
assert 10 ** 2 == 100
322322
```
323323

0 commit comments

Comments
 (0)