Skip to content

Commit 88f5ec2

Browse files
authored
array: encourage use of List; show literal syntax
I think this is a good start to a more useful intro to Array. I don't know enough about why I would use Array vs List to add that info myself, but I think it should be here and on the List page.
1 parent a9c55d8 commit 88f5ec2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/stdlib/array.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22
title: Array
33
---
44

5-
Utilities for working with arrays.
5+
Utilities for working with arrays. Array is a lower level implementation than [List](./list); prefer working with List. You can use [toList](#toList) and [fromList](#fromList) to easily convert an Array to/from a List.
6+
7+
You can create an Array using Array literal syntax:
8+
9+
```grain
10+
let array = [> 1, 2, 3]
11+
```
12+
13+
Note the `>`! If you omit this, Grain will create a List.
614

715
<details>
816
<summary>Added in <code>0.2.0</code></summary>

0 commit comments

Comments
 (0)