From d979c98aec1d1e272b2519b55b0df13103efee65 Mon Sep 17 00:00:00 2001 From: Cristiano Calcagno Date: Wed, 9 Nov 2022 09:41:42 +0100 Subject: [PATCH 1/2] Update docs for list spread. --- pages/docs/manual/latest/array-and-list.mdx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pages/docs/manual/latest/array-and-list.mdx b/pages/docs/manual/latest/array-and-list.mdx index 837a06110..780bb1831 100644 --- a/pages/docs/manual/latest/array-and-list.mdx +++ b/pages/docs/manual/latest/array-and-list.mdx @@ -123,9 +123,7 @@ var anotherList = { `myList` didn't mutate. `anotherList` is now `list{0, 1, 2, 3}`. This is efficient (constant time, not linear). `anotherList`'s last 3 elements are shared with `myList`! -**Note that `list{a, ...b, ...c}` is a syntax error**. We don't support multiple spread for a list. That'd be an accidental linear operation (`O(b)`), since each item of b would be one-by-one added to the head of `c`. You can use `List.concat` for this, but we highly discourage it. - -Updating an arbitrary item in the middle of a list is also discouraged, since its performance and allocation overhead would be linear (`O(n)`). +**Note that `list{a, ...b, ...c}` is a syntax error** in compiler v10.0 or earlier. In general, the pattern should be used with care as its performance and allocation overhead are linear (`O(n)`). #### Access From 90d62d279d6e942b1ace479c498c14663ac89468 Mon Sep 17 00:00:00 2001 From: Cristiano Calcagno Date: Wed, 9 Nov 2022 09:43:43 +0100 Subject: [PATCH 2/2] Update array-and-list.mdx --- pages/docs/manual/latest/array-and-list.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/docs/manual/latest/array-and-list.mdx b/pages/docs/manual/latest/array-and-list.mdx index 780bb1831..f6b0f80c2 100644 --- a/pages/docs/manual/latest/array-and-list.mdx +++ b/pages/docs/manual/latest/array-and-list.mdx @@ -123,7 +123,7 @@ var anotherList = { `myList` didn't mutate. `anotherList` is now `list{0, 1, 2, 3}`. This is efficient (constant time, not linear). `anotherList`'s last 3 elements are shared with `myList`! -**Note that `list{a, ...b, ...c}` is a syntax error** in compiler v10.0 or earlier. In general, the pattern should be used with care as its performance and allocation overhead are linear (`O(n)`). +**Note that `list{a, ...b, ...c}` was a syntax error** before compiler v10.1. In general, the pattern should be used with care as its performance and allocation overhead are linear (`O(n)`). #### Access