From 88f5ec2f83d430b6af651516d302a6fdff931c0d Mon Sep 17 00:00:00 2001 From: Chad Ostrowski <221614+chadoh@users.noreply.github.com> Date: Fri, 3 Dec 2021 10:18:03 -0500 Subject: [PATCH] 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. --- src/stdlib/array.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/stdlib/array.md b/src/stdlib/array.md index 120b64e8..47f63eb4 100644 --- a/src/stdlib/array.md +++ b/src/stdlib/array.md @@ -2,7 +2,15 @@ title: Array --- -Utilities for working with arrays. +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. + +You can create an Array using Array literal syntax: + +```grain +let array = [> 1, 2, 3] +``` + +Note the `>`! If you omit this, Grain will create a List.
Added in 0.2.0