You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/gleam/list.gleam
+10-40Lines changed: 10 additions & 40 deletions
Original file line number
Diff line number
Diff line change
@@ -1118,40 +1118,6 @@ pub fn intersperse(list: List(a), with elem: a) -> List(a) {
1118
1118
}
1119
1119
}
1120
1120
1121
-
/// Returns the element in the Nth position in the list, with 0 being the first
1122
-
/// position.
1123
-
///
1124
-
/// `Error(Nil)` is returned if the list is not long enough for the given index
1125
-
/// or if the index is less than 0.
1126
-
///
1127
-
/// ## Examples
1128
-
///
1129
-
/// ```gleam
1130
-
/// at([1, 2, 3], 1)
1131
-
/// // -> Ok(2)
1132
-
/// ```
1133
-
///
1134
-
/// ```gleam
1135
-
/// at([1, 2, 3], 5)
1136
-
/// // -> Error(Nil)
1137
-
/// ```
1138
-
///
1139
-
@deprecated("
1140
-
1141
-
Gleam lists are immutable linked lists, so indexing into them is a slow operation that must traverse the list.
1142
-
1143
-
In functional programming it is very rare to use indexing, so if you are using indexing then a different algorithm or a different data structure is likely more appropriate.
0 commit comments