From 70fdc19e0d7fc52f314fe60dedfc4d9893e8698d Mon Sep 17 00:00:00 2001 From: Evgenii Akentev Date: Sun, 23 Jul 2023 20:22:26 +0400 Subject: [PATCH] Add comment about internal representation --- src/System/IO/LineIndexedCursor.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/System/IO/LineIndexedCursor.hs b/src/System/IO/LineIndexedCursor.hs index f720038..f7a26b3 100644 --- a/src/System/IO/LineIndexedCursor.hs +++ b/src/System/IO/LineIndexedCursor.hs @@ -10,6 +10,10 @@ -- -- Lazily builds the index with the line numbers while reading the file -- making it possible to rewind to them quickly later. +-- +-- The indices are stored using a list, with a fixed length capacity, and 'Data.Array'. +-- Each new element is added to the list and when the capacity is reached, the list items get flushed +-- to the array for faster access. The list's capacity can be configured using 'mkLineIndexedCursorWithCapacity'. ----------------------------------------------------------------------------- module System.IO.LineIndexedCursor -- 2.34.1