git.iko.soy/typeable/pandoc
on master help sign in
Fixed compiler warnings.
2f54de7John MacFarlane
src/Text/Pandoc/Parsing.hs+3−3
@@ -865,7 +865,7 @@ gridTableFooter = blanklines
865---
865---
866
866
867-- | Removes the ParsecT layer from the monad transformer stack
867-- | Removes the ParsecT layer from the monad transformer stack
868−readWithM :: (Monad m, Functor m)
868+readWithM :: (Monad m)
869 => ParserT [Char] st m a -- ^ parser
869 => ParserT [Char] st m a -- ^ parser
870 -> st -- ^ initial state
870 -> st -- ^ initial state
871 -> String -- ^ input
871 -> String -- ^ input
@@ -891,7 +891,7 @@ readWithWarnings p = readWith $ do
891 return (doc, warnings)
891 return (doc, warnings)
892
892
893-- | Parse a string with @parser@ (for testing).
893-- | Parse a string with @parser@ (for testing).
894−testStringWith :: (Show a, Stream [Char] Identity Char)
894+testStringWith :: (Show a)
895 => ParserT [Char] ParserState Identity a
895 => ParserT [Char] ParserState Identity a
896 -> [Char]
896 -> [Char]
897 -> IO ()
897 -> IO ()
@@ -1267,7 +1267,7 @@ addWarning mbpos msg =
1267 stateWarnings = (msg ++ maybe "" (\pos -> " " ++ show pos) mbpos) :
1267 stateWarnings = (msg ++ maybe "" (\pos -> " " ++ show pos) mbpos) :
1268 stateWarnings st }
1268 stateWarnings st }
1269infixr 5 <+?>
1269infixr 5 <+?>
1270−(<+?>) :: (Monoid a, Monad m) => ParserT s st m a -> ParserT s st m a -> ParserT s st m a
1270+(<+?>) :: (Monoid a) => ParserT s st m a -> ParserT s st m a -> ParserT s st m a
1271a <+?> b = a >>= flip fmap (try b <|> return mempty) . (<>)
1271a <+?> b = a >>= flip fmap (try b <|> return mempty) . (<>)
1272
1272
1273extractIdClass :: Attr -> Attr
1273extractIdClass :: Attr -> Attr
src/Text/Pandoc/Pretty.hs+2−4
@@ -208,8 +208,7 @@ chomp d = Doc (fromList dl')
208 go (Prefixed s d' : xs) = Prefixed s (chomp d') : xs
208 go (Prefixed s d' : xs) = Prefixed s (chomp d') : xs
209 go xs = xs
209 go xs = xs
210
210
211−outp :: (IsString a, Monoid a)
212− => Int -> String -> DocState a
211+outp :: (IsString a) => Int -> String -> DocState a
213outp off s | off < 0 = do -- offset < 0 means newline characters
212outp off s | off < 0 = do -- offset < 0 means newline characters
214 st' <- get
213 st' <- get
215 let rawpref = prefix st'
214 let rawpref = prefix st'
@@ -234,8 +233,7 @@ outp off s = do -- offset >= 0 (0 might be combining char)
234-- | Renders a 'Doc'. @render (Just n)@ will use
233-- | Renders a 'Doc'. @render (Just n)@ will use
235-- a line length of @n@ to reflow text on breakable spaces.
234-- a line length of @n@ to reflow text on breakable spaces.
236-- @render Nothing@ will not reflow text.
235-- @render Nothing@ will not reflow text.
237−render :: (Monoid a, IsString a)
236+render :: (IsString a) => Maybe Int -> Doc -> a
238− => Maybe Int -> Doc -> a
239render linelen doc = fromString . mconcat . reverse . output $
237render linelen doc = fromString . mconcat . reverse . output $
240 execState (renderDoc doc) startingState
238 execState (renderDoc doc) startingState
241 where startingState = RenderState{
239 where startingState = RenderState{
src/Text/Pandoc/Readers/TWiki.hs+4−4
@@ -205,7 +205,7 @@ orderedList :: String -> TWParser B.Blocks
205orderedList prefix = tryMsg "orderedList" $
205orderedList prefix = tryMsg "orderedList" $
206 parseList prefix (oneOf "1iIaA") (string ". ")
206 parseList prefix (oneOf "1iIaA") (string ". ")
207
207
208−parseList :: Show a => String -> TWParser Char -> TWParser a -> TWParser B.Blocks
208+parseList :: String -> TWParser Char -> TWParser a -> TWParser B.Blocks
209parseList prefix marker delim = do
209parseList prefix marker delim = do
210 (indent, style) <- lookAhead $ string prefix *> listStyle <* delim
210 (indent, style) <- lookAhead $ string prefix *> listStyle <* delim
211 blocks <- many $ parseListItem (prefix ++ indent) (char style <* delim)
211 blocks <- many $ parseListItem (prefix ++ indent) (char style <* delim)
@@ -281,7 +281,7 @@ tableParseColumn = char '|' *> skipSpaces *>
281tableEndOfRow :: TWParser Char
281tableEndOfRow :: TWParser Char
282tableEndOfRow = lookAhead (try $ char '|' >> char '\n') >> char '|'
282tableEndOfRow = lookAhead (try $ char '|' >> char '\n') >> char '|'
283
283
284−tableColumnContent :: Show a => TWParser a -> TWParser B.Blocks
284+tableColumnContent :: TWParser a -> TWParser B.Blocks
285tableColumnContent end = manyTill content (lookAhead $ try end) >>= return . B.plain . mconcat
285tableColumnContent end = manyTill content (lookAhead $ try end) >>= return . B.plain . mconcat
286 where
286 where
287 content = continuation <|> inline
287 content = continuation <|> inline
@@ -351,11 +351,11 @@ linebreak = newline >> notFollowedBy newline >> (lastNewline <|> innerNewline)
351 where lastNewline = eof >> return mempty
351 where lastNewline = eof >> return mempty
352 innerNewline = return B.space
352 innerNewline = return B.space
353
353
354−between :: (Show b, Monoid c) => TWParser a -> TWParser b -> (TWParser b -> TWParser c) -> TWParser c
354+between :: (Monoid c) => TWParser a -> TWParser b -> (TWParser b -> TWParser c) -> TWParser c
355between start end p =
355between start end p =
356 mconcat <$> try (start >> notFollowedBy whitespace >> many1Till (p end) end)
356 mconcat <$> try (start >> notFollowedBy whitespace >> many1Till (p end) end)
357
357
358−enclosed :: (Show a, Monoid b) => TWParser a -> (TWParser a -> TWParser b) -> TWParser b
358+enclosed :: (Monoid b) => TWParser a -> (TWParser a -> TWParser b) -> TWParser b
359enclosed sep p = between sep (try $ sep <* endMarker) p
359enclosed sep p = between sep (try $ sep <* endMarker) p
360 where
360 where
361 endMarker = lookAhead $ skip endSpace <|> skip (oneOf ".,!?:)|") <|> eof
361 endMarker = lookAhead $ skip endSpace <|> skip (oneOf ".,!?:)|") <|> eof
src/Text/Pandoc/Readers/Txt2Tags.hs+1−1
@@ -285,7 +285,7 @@ table = try $ do
285 (zip aligns (replicate ncolumns 0.0))
285 (zip aligns (replicate ncolumns 0.0))
286 headerPadded rowsPadded
286 headerPadded rowsPadded
287
287
288−pad :: (Show a, Monoid a) => Int -> [a] -> [a]
288+pad :: (Monoid a) => Int -> [a] -> [a]
289pad n xs = xs ++ (replicate (n - length xs) mempty)
289pad n xs = xs ++ (replicate (n - length xs) mempty)
290
290
291
291
src/Text/Pandoc/Writers/Docx.hs−1
@@ -38,7 +38,6 @@ import qualified Data.Set as Set
38import qualified Text.Pandoc.UTF8 as UTF8
38import qualified Text.Pandoc.UTF8 as UTF8
39import Codec.Archive.Zip
39import Codec.Archive.Zip
40import Data.Time.Clock.POSIX
40import Data.Time.Clock.POSIX
41−import Data.Time.Clock
42import System.Environment
41import System.Environment
43import Text.Pandoc.Compat.Time
42import Text.Pandoc.Compat.Time
44import Text.Pandoc.Definition
43import Text.Pandoc.Definition
src/Text/Pandoc/Writers/EPUB.hs+1−1
@@ -888,7 +888,7 @@ transformInline opts mediaRef (RawInline fmt raw)
888 return $ RawInline fmt (renderTags' tags')
888 return $ RawInline fmt (renderTags' tags')
889transformInline _ _ x = return x
889transformInline _ _ x = return x
890
890
891−(!) :: Node t => (t -> Element) -> [(String, String)] -> t -> Element
891+(!) :: (t -> Element) -> [(String, String)] -> t -> Element
892(!) f attrs n = add_attrs (map (\(k,v) -> Attr (unqual k) v) attrs) (f n)
892(!) f attrs n = add_attrs (map (\(k,v) -> Attr (unqual k) v) attrs) (f n)
893
893
894-- | Version of 'ppTopElement' that specifies UTF-8 encoding.
894-- | Version of 'ppTopElement' that specifies UTF-8 encoding.