File tree Expand file tree Collapse file tree 4 files changed +650
-81
lines changed Expand file tree Collapse file tree 4 files changed +650
-81
lines changed Original file line number Diff line number Diff line change @@ -22,30 +22,30 @@ _The `--no-quarantine` flag will avoid having to approve the binary in the Secur
22
22
23
23
### MacOS x64 - Download
24
24
25
- If you'd prefer not to use homebrew, you can [ download it] ( https://github.com/grain-lang/grain/releases/download/grain-v0.4.3 /grain-mac-x64 ) directly from GitHub or using ` curl ` .
25
+ If you'd prefer not to use homebrew, you can [ download it] ( https://github.com/grain-lang/grain/releases/download/grain-v0.4.4 /grain-mac-x64 ) directly from GitHub or using ` curl ` .
26
26
27
27
``` sh
28
28
sudo curl -L --output /usr/local/bin/grain \
29
- https://github.com/grain-lang/grain/releases/download/grain-v0.4.3 /grain-mac-x64 \
29
+ https://github.com/grain-lang/grain/releases/download/grain-v0.4.4 /grain-mac-x64 \
30
30
&& sudo chmod +x /usr/local/bin/grain
31
31
```
32
32
33
33
### Linux x64 - Download
34
34
35
- You can [ download it] ( https://github.com/grain-lang/grain/releases/download/grain-v0.4.3 /grain-linux-x64 ) directly from GitHub or using ` curl ` .
35
+ You can [ download it] ( https://github.com/grain-lang/grain/releases/download/grain-v0.4.4 /grain-linux-x64 ) directly from GitHub or using ` curl ` .
36
36
37
37
``` sh
38
38
sudo curl -L --output /usr/local/bin/grain \
39
- https://github.com/grain-lang/grain/releases/download/grain-v0.4.3 /grain-linux-x64 \
39
+ https://github.com/grain-lang/grain/releases/download/grain-v0.4.4 /grain-linux-x64 \
40
40
&& sudo chmod +x /usr/local/bin/grain
41
41
```
42
42
43
43
### Windows x64 - Download
44
44
45
- You can [ download it] ( https://github.com/grain-lang/grain/releases/download/grain-v0.4.3 /grain-win-x64.exe ) directly from GitHub or using ` curl ` .
45
+ You can [ download it] ( https://github.com/grain-lang/grain/releases/download/grain-v0.4.4 /grain-win-x64.exe ) directly from GitHub or using ` curl ` .
46
46
47
47
``` batch
48
- curl -LO https://github.com/grain-lang/grain/releases/download/grain-v0.4.3 /grain-win-x64.exe
48
+ curl -LO https://github.com/grain-lang/grain/releases/download/grain-v0.4.4 /grain-win-x64.exe
49
49
```
50
50
51
51
You'll either want to put it into your path or keep it inside your project and invoke with ` .\grain-win-x64.exe ` .
Original file line number Diff line number Diff line change @@ -263,6 +263,27 @@ Returns:
263
263
| ----| -----------|
264
264
| ` Array<a> ` | The new array containing the elements from the input|
265
265
266
+ ### Array.** cycle**
267
+
268
+ <details disabled >
269
+ <summary tabindex =" -1 " >Added in <code >next</code ></summary >
270
+ No other changes yet.
271
+ </details >
272
+
273
+ ``` grain
274
+ cycle : ((a -> Void), Number, Array<a>) -> Void
275
+ ```
276
+
277
+ Iterates an array a given number of times, calling an iterator function on each element.
278
+
279
+ Parameters:
280
+
281
+ | param| type| description|
282
+ | -----| ----| -----------|
283
+ | ` fn ` | ` a -> Void ` | The iterator function to call with each element|
284
+ | ` n ` | ` Number ` | The number of times to iterate the given array|
285
+ | ` array ` | ` Array<a> ` | The array to iterate|
286
+
266
287
### Array.** forEach**
267
288
268
289
<details >
Original file line number Diff line number Diff line change 2
2
title : Hash
3
3
---
4
4
5
- Utilities for hashing.
5
+ Utilities for hashing any value.
6
+
7
+ <details disabled >
8
+ <summary tabindex =" -1 " >Added in <code >0.1.0</code ></summary >
9
+ No other changes yet.
10
+ </details >
6
11
7
12
``` grain
8
13
import Hash from "hash"
9
14
```
10
15
11
16
## Values
12
17
18
+ Functions for hashing.
19
+
13
20
### Hash.** hash**
14
21
22
+ <details disabled >
23
+ <summary tabindex =" -1 " >Added in <code >0.1.0</code ></summary >
24
+ No other changes yet.
25
+ </details >
26
+
15
27
``` grain
16
28
hash : a -> Number
17
29
```
18
30
19
- Generic hashing.
31
+ A generic hash function that produces an integer from any value. If ` a == b ` then ` Hash.hash(a) == Hash.hash(b) ` .
32
+
33
+ Parameters:
34
+
35
+ | param| type| description|
36
+ | -----| ----| -----------|
37
+ | ` anything ` | ` a ` | The value to hash|
38
+
39
+ Returns:
40
+
41
+ | type| description|
42
+ | ----| -----------|
43
+ | ` Number ` | A hash for the given value|
20
44
21
- Takes any value and produces an integer. If ` a == b ` then ` Hash.hash(a) == Hash.hash(b) ` .
You can’t perform that action at this time.
0 commit comments