diff --git a/src/PDF/Text.hs b/src/PDF/Text.hs index 7927561..ec40769 100644 --- a/src/PDF/Text.hs +++ b/src/PDF/Text.hs @@ -1,8 +1,8 @@ {-# LANGUAGE OverloadedStrings #-} -module PDF.Text ( +module PDF.Text {-( PageContents(..) , pageContents - ) where + )-} where import Control.Applicative ((<|>)) import Control.Monad (foldM, join) @@ -61,7 +61,7 @@ textOperator Tf = (,) Tf <$> sequence [Typed . NameObject <$> name, argument] <* textOperator Tr = (,) Tr <$> count 1 argument <* string "Tr" textOperator Ts = (,) Ts <$> count 1 argument <* string "Ts" -a :: (Bounded o, Enum o) => (o -> ParserWithFont (Call o)) -> ParserWithFont (Call o) +a :: (Bounded o, Enum o, MonadParser m) => (o -> m (Call o)) -> m (Call o) a parserGenerator = choice $ parserGenerator <$> [minBound .. maxBound] argument :: MonadParser m => m Argument @@ -84,7 +84,7 @@ graphicState :: ParserWithFont [ByteString] graphicState = string "q" *> blank *> insideQ <* string "Q" where - insideQ = join <$> (command <|> page `sepBy` blank ) + insideQ = join <$> ((command <|> page) `sepBy` blank ) command = a stateOperator *> return [] text :: ParserWithFont [ByteString]