xlsx-1.1.2.2: Simple and incomplete Excel file parser/writer

Safe Haskell | Safe-Inferred
Language | Haskell2010

Codec.Xlsx.Parser

Description

This module provides a function for reading .xlsx files

Synopsis

- toXlsx :: ByteString -> Xlsx
- toXlsxEither :: ByteString -> Parser Xlsx
- toXlsxFast :: ByteString -> Xlsx
- toXlsxEitherFast :: ByteString -> Parser Xlsx
- data ParseError
  - = InvalidZipArchive String
  - | MissingFile FilePath
  - | InvalidFile FilePath Text
  - | InvalidRef FilePath RefId
  - | InconsistentXlsx Text
- type Parser = Either ParseError

# Documentation

toXlsx :: ByteString -> Xlsx Source #

Reads `Xlsx` from raw data (lazy bytestring)

toXlsxEither :: ByteString -> Parser Xlsx Source #

Reads `Xlsx` from raw data (lazy bytestring), failing with `Left` on parse error

toXlsxFast :: ByteString -> Xlsx Source #

Reads `Xlsx` from raw data (lazy bytestring) using `xeno` library using some "cheating":

- not doing 100% xml validation
- replacing only predefined entities and Unicode character references (without checking codepoint validity)
- almost not using XML namespaces

toXlsxEitherFast :: ByteString -> Parser Xlsx Source #

Fast parsing with `Left` on parse error, see `toXlsxFast`

data ParseError Source #

Constructors

InvalidZipArchive String |
MissingFile FilePath |
InvalidFile FilePath Text |
InvalidRef FilePath RefId |
InconsistentXlsx Text |

#### Instances

Instances details

Exception ParseError Source # |
Instance details Defined in Codec.Xlsx.Parser Methods toException :: ParseError -> SomeException Source # fromException :: SomeException -> Maybe ParseError Source # displayException :: ParseError -> String Source #
Generic ParseError Source # |
Instance details Defined in Codec.Xlsx.Parser Associated Types type Rep ParseError :: Type -> Type Source # Methods from :: ParseError -> Rep ParseError x Source # to :: Rep ParseError x -> ParseError Source #
Show ParseError Source # |
Instance details Defined in Codec.Xlsx.Parser Methods showsPrec :: Int -> ParseError -> ShowS Source # show :: ParseError -> String Source # showList :: [ParseError] -> ShowS Source #
Eq ParseError Source # |
Instance details Defined in Codec.Xlsx.Parser Methods (==) :: ParseError -> ParseError -> Bool Source # (/=) :: ParseError -> ParseError -> Bool Source #
type Rep ParseError Source # |

Instance details

Defined in Codec.Xlsx.Parser

type Rep ParseError = D1 ('MetaData "ParseError" "Codec.Xlsx.Parser" "xlsx-1.1.2.2-DopzEu8STPN4igxHgE9OUe" 'False) ((C1 ('MetaCons "InvalidZipArchive" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "MissingFile" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath))) :+: (C1 ('MetaCons "InvalidFile" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: (C1 ('MetaCons "InvalidRef" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RefId)) :+: C1 ('MetaCons "InconsistentXlsx" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))))

type Parser = Either ParseError Source #