fileplow-0.1.0.0: Library to process and search large files or a collection of files

Safe HaskellNone
LanguageHaskell2010

Data.FilePlow

Synopsis

Documentation

class PlowHandle hdl where #

Minimal complete definition

pSeek, pTell, pGetChar, pGetLine, pIsEOF, pFileSize

Methods

pSeek :: hdl -> SeekMode -> Integer -> IO () #

pTell :: hdl -> IO Integer #

pGetChar :: hdl -> IO Char #

pGetLine :: hdl -> IO ByteString #

pIsEOF :: hdl -> IO Bool #

pFileSize :: hdl -> IO Integer #

data Handle #

Haskell defines operations to read and write characters from and to files, represented by values of type Handle. Each value of this type is a handle: a record used by the Haskell run-time system to manage I/O with file system objects. A handle has at least the following properties:

  • whether it manages input or output or both;
  • whether it is open, closed or semi-closed;
  • whether the object is seekable;
  • whether buffering is disabled, or enabled on a line or block basis;
  • a buffer (whose length may be zero).

Most handles will also have a current I/O position indicating where the next input or output operation will occur. A handle is readable if it manages only input or both input and output; likewise, it is writable if it manages only output or both input and output. A handle is open when first allocated. Once it is closed it can no longer be used for either input or output, though an implementation cannot re-use its storage while references remain to it. Handles are in the Show and Eq classes. The string produced by showing a handle is system dependent; it should include enough information to identify the handle for debugging. A handle is equal according to == only to itself; no attempt is made to compare the internal state of different handles for equality.

Instances
Eq Handle

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Handle.Types

Methods

(==) :: Handle -> Handle -> Bool #

(/=) :: Handle -> Handle -> Bool #

Show Handle

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Handle.Types

PlowHandle Handle # 
Instance details

Defined in Data.FilePlow

data SeekMode #

A mode that determines the effect of hSeek hdl mode i.

Constructors

AbsoluteSeek

the position of hdl is set to i.

RelativeSeek

the position of hdl is set to offset i from the current position.

SeekFromEnd

the position of hdl is set to offset i from the end of the file.

Instances
Enum SeekMode 
Instance details

Defined in GHC.IO.Device

Eq SeekMode 
Instance details

Defined in GHC.IO.Device

Ord SeekMode 
Instance details

Defined in GHC.IO.Device

Read SeekMode 
Instance details

Defined in GHC.IO.Device

Show SeekMode 
Instance details

Defined in GHC.IO.Device

Ix SeekMode 
Instance details

Defined in GHC.IO.Device

seekUntil :: PlowHandle hdl => hdl -> (Char -> Bool) -> IO Bool #

Seek until a certain charater is reached

seekUntilRev :: PlowHandle hdl => hdl -> (Char -> Bool) -> IO Bool #

Seek until a certain charater is reached in reverse