-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Page-oriented extraction and composition library -- -- Provides an interface to the PageIn export format (.dux) from the -- StreamServe Persuasion(tm) platform, using it both as a data -- extraction as well as a page layout DSL. (Extremely experimental, no -- documentations at the moment!) @package PageIO @version 0.0.2 module Text.PageIO.LabelMap newtype LabelMap a MkLabelMap :: IntMap a -> LabelMap a labelMap :: LabelMap a -> IntMap a newtype Label MkLabel :: Atom -> Label labelAtom :: Label -> Atom toLabel :: (ToAtom a) => a -> Label fromLabel :: (FromAtom a) => Label -> a fromList :: [(Label, a)] -> LabelMap a fromListWith :: (a -> a -> a) -> [(Label, a)] -> LabelMap a toList :: LabelMap a -> [(Label, a)] keyToLabel :: Key -> Label mapWithKey :: (Label -> a -> b) -> LabelMap a -> LabelMap b elems :: LabelMap a -> [a] union :: LabelMap a -> LabelMap a -> LabelMap a unionWith :: (a -> a -> a) -> LabelMap a -> LabelMap a -> LabelMap a unions :: [LabelMap a] -> LabelMap a unionsWith :: (a -> a -> a) -> [LabelMap a] -> LabelMap a lookup :: Label -> LabelMap a -> Maybe a insert :: Label -> a -> LabelMap a -> LabelMap a insertWith :: (a -> a -> a) -> Label -> a -> LabelMap a -> LabelMap a member :: Label -> LabelMap a -> Bool keys :: LabelMap a -> [Label] filter :: (a -> Bool) -> LabelMap a -> LabelMap a mapMaybe :: (a -> Maybe b) -> LabelMap a -> LabelMap b mapMaybeWithKey :: (Label -> a -> Maybe b) -> LabelMap a -> LabelMap b intersection :: LabelMap a -> LabelMap b -> LabelMap a instance Eq Label instance Ord Label instance (Eq a) => Eq (LabelMap a) instance (Ord a) => Ord (LabelMap a) instance Functor LabelMap instance Monoid (LabelMap a) instance Show Label instance (Show a) => Show (LabelMap a) module Text.PageIO.Types newtype Page MkPage :: [Value] -> Page pageLines :: Page -> [Value] type Col = Int type Row = Int type FractionDigits = Int data FieldFormat FGeneral :: FieldFormat FNumeric :: FractionDigits -> FieldFormat FDate :: FieldFormat type Value = ByteString data Box MkBox :: !Col -> !Row -> Col -> !Row -> Box boxLeft :: Box -> !Col boxTop :: Box -> !Row boxRight :: Box -> Col boxBottom :: Box -> !Row data Sheet MkSheet :: !Label -> !Box -> !LabelMap Pattern -> !LabelMap Field -> ![Frame] -> ![Label] -> Sheet sheetName :: Sheet -> !Label sheetBox :: Sheet -> !Box sheetPatterns :: Sheet -> !LabelMap Pattern sheetFields :: Sheet -> !LabelMap Field sheetFrames :: Sheet -> ![Frame] sheetGroupBy :: Sheet -> ![Label] data Pattern MkPattern :: !Box -> !Match -> !Bool -> Pattern patternBox :: Pattern -> !Box patternMatch :: Pattern -> !Match patternUseWildcards :: Pattern -> !Bool data Scope SPage :: Scope SDoc :: Scope data Variable VPage :: Variable VSum :: !Scope -> !Label -> Variable vScope :: Variable -> !Scope vLabel :: Variable -> !Label VCount :: !Scope -> !Label -> Variable vScope :: Variable -> !Scope vLabel :: Variable -> !Label VLabel :: !Label -> Variable vLabel :: Variable -> !Label VLiteral :: !Value -> Variable vValue :: Variable -> !Value data Field MkField :: !Box -> !Maybe Variable -> !Bool -> !FieldFormat -> Field fieldBox :: Field -> !Box fieldVariable :: Field -> !Maybe Variable fieldKeepSpaces :: Field -> !Bool fieldFormat :: Field -> !FieldFormat data Frame MkFrame :: !Box -> !LabelMap Block -> Frame frameBox :: Frame -> !Box frameBlocks :: Frame -> !LabelMap Block data Operator ONot :: !Operator -> Operator OContains :: Operator OEq :: Operator OEndsWith :: Operator OStartsWith :: Operator data Filter MkFilter :: !Label -> !Operator -> !Match -> Filter filterField :: Filter -> !Label filterOperator :: Filter -> !Operator filterMatch :: Filter -> !Match data OrderBy a DAscending :: !a -> OrderBy a DDescending :: !a -> OrderBy a data Block MkBlock :: !Row -> !LabelMap Pattern -> !LabelMap Field -> ![OrderBy Label] -> ![Filter] -> Block blockLines :: Block -> !Row blockPatterns :: Block -> !LabelMap Pattern blockFields :: Block -> !LabelMap Field blockOrderBy :: Block -> ![OrderBy Label] blockFilterBy :: Block -> ![Filter] newtype Match MkMatch :: Value -> Match matchValue :: Match -> Value matches :: Value -> Match -> Bool valToIntVal :: Value -> Value valToInt :: Value -> Int instance Show Match instance Eq Match instance Ord Match instance Show Block instance Eq Block instance Ord Block instance (Show a) => Show (OrderBy a) instance (Eq a) => Eq (OrderBy a) instance Show Filter instance Eq Filter instance Ord Filter instance Show Operator instance Eq Operator instance Ord Operator instance Show Frame instance Eq Frame instance Ord Frame instance Show Field instance Eq Field instance Ord Field instance Show Variable instance Eq Variable instance Ord Variable instance Show Scope instance Eq Scope instance Ord Scope instance Show Pattern instance Eq Pattern instance Ord Pattern instance Show Sheet instance Eq Sheet instance Ord Sheet instance Show Box instance Eq Box instance Ord Box instance Show FieldFormat instance Eq FieldFormat instance Ord FieldFormat instance Show Page instance Eq Page instance Ord Page instance (Ord a) => Ord (OrderBy a) instance Functor OrderBy module Text.PageIO.Extract type Area = Page newtype BlockResult MkBlockResult :: [(Area, LabelMap Value)] -> BlockResult blockResults :: BlockResult -> [(Area, LabelMap Value)] data SheetResult MkSheetResult :: !LabelMap Value -> !LabelMap BlockResult -> SheetResult resultFields :: SheetResult -> !LabelMap Value resultBlocks :: SheetResult -> !LabelMap BlockResult prettyEntry :: (Show a) => (Label, a) -> String extractPage :: Sheet -> Page -> Maybe SheetResult crop :: Box -> Page -> Page checkPattern :: Page -> Pattern -> Bool extractField :: Page -> Field -> Value extractBlocks :: LabelMap Block -> Page -> [(Label, BlockResult)] extractBlock :: Block -> Page -> Maybe BlockResult pageVal :: Page -> Value instance Eq SheetResult instance Ord SheetResult instance Eq BlockResult instance Ord BlockResult instance Monoid BlockResult instance Show SheetResult instance Show BlockResult instance Monoid SheetResult module Text.PageIO.Transform data Doc MkDoc :: !SheetResult -> !ByteString -> Doc docMeta :: Doc -> !SheetResult docContent :: Doc -> !ByteString type ValueMap = LabelMap [Value] data AppliedVariable MkAppliedVariable :: !Row -> !Col -> !Value -> AppliedVariable avRow :: AppliedVariable -> !Row avCol :: AppliedVariable -> !Col avValue :: AppliedVariable -> !Value data Slot MkSlot :: !Row -> ![Label] -> Slot slotSize :: Slot -> !Row slotBlocks :: Slot -> ![Label] type Ordered a = ([OrderBy (Maybe Value)], a) data BlockData MkBlockData :: !Row -> ![Ordered Area] -> BlockData dataSize :: BlockData -> !Row dataAreas :: BlockData -> ![Ordered Area] type PageCapacity = [Slot] type FitAttempt = LabelMap BlockData type PageBinding = LabelMap [Area] parsePages :: Sheet -> [Page] -> [Doc] emitDoc :: [(SheetResult, Page)] -> Doc transformPages :: Sheet -> [Page] -> Sheet -> [Page] -> [Doc] makeDoc :: Sheet -> [DocBinding] -> Doc packPages :: [Page] -> ByteString data DocBinding MkDocBinding :: !SheetResult -> !Page -> !PageBinding -> DocBinding docResult :: DocBinding -> !SheetResult docPage :: DocBinding -> !Page docBinding :: DocBinding -> !PageBinding bindDoc :: Sheet -> [Page] -> [SheetResult] -> [DocBinding] repeatTails :: [a] -> [[a]] fillVariables :: Sheet -> [SheetResult] -> [Page] -> [Page] makeValueMap :: SheetResult -> ValueMap makePage :: Sheet -> PageBinding -> Page -> Page replaceArea :: Box -> [Area] -> Page -> Page clearArea :: Box -> Page -> Page fillArea :: Row -> Col -> Area -> Page -> Page fillLine :: Col -> (Value, Value) -> Value doCapacity :: Sheet -> SheetResult -> [PageCapacity] -> [PageCapacity] doAttempt :: LabelMap [OrderBy Label] -> SheetResult -> FitAttempt -> FitAttempt areaRows :: Area -> Row fillPageVariables :: LabelMap AppliedVariable -> Page -> Page valueToArea :: Value -> Area sheetVariableFields :: Sheet -> LabelMap Field sheetBlockOrderBys :: Sheet -> LabelMap [OrderBy Label] tryFit :: [PageCapacity] -> FitAttempt -> Maybe [PageBinding] fitOnePage :: [Slot] -> (PageBinding, FitAttempt) -> (PageBinding, FitAttempt) fitOneSlot :: Slot -> (PageBinding, FitAttempt) -> (PageBinding, FitAttempt) instance Show DocBinding instance Eq DocBinding instance Ord DocBinding instance Eq BlockData instance Ord BlockData instance Show BlockData instance Eq Slot instance Ord Slot instance Show Slot instance Show AppliedVariable instance Eq AppliedVariable instance Ord AppliedVariable instance Show Doc instance Eq Doc instance Ord Doc instance Monoid BlockData module Text.PageIO.Parser readSheet :: FilePath -> IO Sheet parseMaybe :: Parser a -> Parser (Maybe a) maybeFieldVariable :: Parser (Maybe Variable) literalVariable :: Parser Variable functionVariable :: Parser Variable bareLabel :: Parser Label maybeFieldFormat :: Parser (Maybe FieldFormat) maybeFilters :: Parser (Maybe [Filter]) parseFilter :: Parser Filter operator :: Parser Operator maybeOrderBys :: Parser (Maybe [OrderBy Label]) maybeBy :: String -> Parser (Maybe [Label]) maybeRule :: Parser (Maybe a) -> Parser (Maybe a) parseLabel :: Parser Label sheet :: Parser Sheet sym :: String -> Parser () ret :: a -> Parser a sp :: Parser () num :: Parser Int pattern :: Parser (Label, Pattern) field :: Parser (Label, Field) boxNumbers :: Parser Box frame :: Parser Frame retLabel :: Label -> a -> Parser (Label, a) block :: Parser (Label, Block) literalStr :: Parser Value matchStr :: Parser Match mkMatch :: Value -> Match packLBS :: ByteString -> ByteString labelStr :: Parser Label str :: Parser ByteString quotedValue :: Parser Value module Text.PageIO.Run readPages :: FilePath -> IO [Page] hReadPages :: Handle -> IO [Page] hReadPagesLazy :: Handle -> IO [Page] hReadPagesStrict :: Handle -> Int -> IO [Page] putPage :: Page -> IO () module Text.PageIO