Skip to content

Commit c583340

Browse files
authored
Update docs for list spread. (#598)
* Update docs for list spread. * Update array-and-list.mdx
1 parent bcfa75f commit c583340

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pages/docs/manual/latest/array-and-list.mdx

+1-3
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ var anotherList = {
123123

124124
`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`!
125125

126-
**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.
127-
128-
Updating an arbitrary item in the middle of a list is also discouraged, since its performance and allocation overhead would be linear (`O(n)`).
126+
**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)`).
129127

130128
#### Access
131129

0 commit comments

Comments
 (0)