Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Data/Array.purs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
-- | `Data.Sequence` instead, which might give better performance for certain
-- | use cases. This module is useful when integrating with JavaScript libraries
-- | which use arrays, but immutable arrays are not a practical data structure
-- | for many use cases due to their poor asymptotics.
-- | for many use cases due to their poor asymptotics. The running time of all
-- | array modification operations (`cons`, `snoc`, etc.) are at least as slow as
-- | `O(n)` because a copy of the array must be created to preserve immutability.
-- |
-- | In addition to the functions in this module, Arrays have a number of
-- | useful instances:
Expand Down Expand Up @@ -246,6 +248,7 @@ infixr 6 cons as :
-- | snoc [1, 2, 3] 4 = [1, 2, 3, 4]
-- | ```
-- |
-- | Note, the running time of this function is `O(n)`.
foreign import snoc :: forall a. Array a -> a -> Array a

-- | Insert an element into a sorted array.
Expand Down