line-indexed-cursor-0.1.0.0: Line-indexed file reader.
Maintainer[email protected]
Safe HaskellSafe-Inferred
LanguageHaskell2010

System.IO.LineIndexedCursor

Description

Line-indexed file reader.

Lazily builds the index with the line numbers while reading the file making it possible to rewind to them quickly later.

Synopsis

Documentation

data LineIndexedCursor Source #

ADT with methods, hiding the internal state.

getCurrentLine, getCurrentLineUnsafe, doFullScan, and goToLine, all throw IOError.

Constructors

LineIndexedCursor 

Fields

mkLineIndexedCursor :: Handle -> IO LineIndexedCursor Source #

Builds LineIndexedCursor. Resets the file handle's ofsset to the beginning.

Use hSetNewlineMode if you want to configure NewlineMode.

mkLineIndexedCursorWithCapacity :: Handle -> Integer -> IO LineIndexedCursor Source #

Same as mkLineIndexedCursor but allows to configure the list's capacity.