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
2222
2323### MacOS x64 - Download
2424
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 ` .
2626
2727``` sh
2828sudo 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 \
3030&& sudo chmod +x /usr/local/bin/grain
3131```
3232
3333### Linux x64 - Download
3434
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 ` .
3636
3737``` sh
3838sudo 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 \
4040&& sudo chmod +x /usr/local/bin/grain
4141```
4242
4343### Windows x64 - Download
4444
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 ` .
4646
4747``` 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
4949```
5050
5151You'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:
263263| ----| -----------|
264264| ` Array<a> ` | The new array containing the elements from the input|
265265
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+
266287### Array.** forEach**
267288
268289<details >
Original file line number Diff line number Diff line change 22title : Hash
33---
44
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 >
611
712``` grain
813import Hash from "hash"
914```
1015
1116## Values
1217
18+ Functions for hashing.
19+
1320### Hash.** hash**
1421
22+ <details disabled >
23+ <summary tabindex =" -1 " >Added in <code >0.1.0</code ></summary >
24+ No other changes yet.
25+ </details >
26+
1527``` grain
1628hash : a -> Number
1729```
1830
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|
2044
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