Skip to content

Commit c7eb86c

Browse files
author
Jaro Reinders
committed
Slightly more docs
1 parent 2019bb2 commit c7eb86c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Fleet/Array.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ Stability : experimental
1111
Portability : Portable
1212
1313
This module defines fleet arrays and their basic interface.
14+
15+
All the asymptotic complexities listed in this module assume you are modifying
16+
the latest version of the array. Otherwise the performance regresses to O(k),
17+
where k is the number of changes between the version you are accessing and the
18+
latest version.
1419
-}
1520
module Fleet.Array (Array, fromList, toList, (!), index, set, copy, swap, aseq) where
1621

@@ -21,6 +26,7 @@ import Data.Kind (Type)
2126

2227
data Op a = Set Int# a | Swap Int# Int#
2328

29+
-- | Fleet arrays.
2430
data Array a = DA (MutVar# RealWorld (ArrayData a))
2531
type ArrayData :: Type -> UnliftedType
2632
data ArrayData a
@@ -76,7 +82,7 @@ DA v ! I# i = helper v i where
7682

7783
-- | Indexing an array. O(1)
7884
-- Using the 'Solo' constructor, you can sequence indexing to happen before
79-
-- future updates without having to evaluate the resulting element.
85+
-- future updates without having to evaluate the element itself.
8086
{-# INLINE index #-}
8187
index :: Int -> Array a -> Solo a
8288
index (I# i) (DA v) = helper v i where

0 commit comments

Comments
 (0)