git.iko.soy/typeable/pandoc
on master help sign in
Fix redundant constraint warnings. (#5625)
commit24c781039fb280604eb1a73dd7de154db9e1e236 authorPete Ryland <pdr@pdr.cx> dateTue 2 Jul 2019, 10:29 (7 years ago) parentb6c5355
11 files changed+20−23
src/Text/Pandoc/Lua/Filter.hs+1−1 src/Text/Pandoc/Lua/Module/Pandoc.hs+1−1 src/Text/Pandoc/Parsing.hs+6−8 src/Text/Pandoc/Readers/HTML.hs+2−2 src/Text/Pandoc/Readers/Ipynb.hs+1−1 src/Text/Pandoc/Readers/LaTeX.hs+1−1 src/Text/Pandoc/Readers/Man.hs+1−2 src/Text/Pandoc/Readers/Org/Blocks.hs+1−1 src/Text/Pandoc/Readers/TikiWiki.hs+2−2 src/Text/Pandoc/Writers/Shared.hs+3−3 test/Tests/Lua.hs+1−1
src/Text/Pandoc/Lua/Filter.hs+1−1
@@ -129,7 +129,7 @@ walkMWithLuaFilter :: LuaFilter -> Pandoc -> Lua Pandoc
129129walkMWithLuaFilter f =
130130 walkInlines f >=> walkBlocks f >=> walkMeta f >=> walkPandoc f
131131
132−mconcatMapM :: (Monad m, Functor m) => (a -> m [a]) -> [a] -> m [a]
132+mconcatMapM :: (Monad m) => (a -> m [a]) -> [a] -> m [a]
133133mconcatMapM f = fmap mconcat . mapM f
134134
135135hasOneOf :: LuaFilter -> [String] -> Bool
src/Text/Pandoc/Lua/Module/Pandoc.hs+1−1
@@ -46,7 +46,7 @@ pushModule datadir = do
4646 LuaUtil.addFunction "walk_inline" walkInline
4747 return 1
4848
49−walkElement :: (Pushable a, Walkable [Inline] a, Walkable [Block] a)
49+walkElement :: (Walkable [Inline] a, Walkable [Block] a)
5050 => a -> LuaFilter -> Lua a
5151walkElement x f = walkInlines f x >>= walkBlocks f
5252
src/Text/Pandoc/Parsing.hs+6−8
@@ -313,8 +313,7 @@ many1Till p end = do
313313 return (first:rest)
314314
315315-- | Like @manyTill@, but also returns the result of end parser.
316−manyUntil :: (Stream s m t)
317− => ParserT s u m a
316+manyUntil :: ParserT s u m a
318317 -> ParserT s u m b
319318 -> ParserT s u m ([a], b)
320319manyUntil p end = scan
@@ -328,8 +327,7 @@ manyUntil p end = scan
328327
329328-- | Like @sepBy1@ from Parsec,
330329-- but does not fail if it @sep@ succeeds and @p@ fails.
331−sepBy1' :: (Stream s m t)
332− => ParsecT s u m a
330+sepBy1' :: ParsecT s u m a
333331 -> ParsecT s u m sep
334332 -> ParsecT s u m [a]
335333sepBy1' p sep = (:) <$> p <*> many (try $ sep >> p)
@@ -440,7 +438,7 @@ stringAnyCase (x:xs) = do
440438 return (firstChar:rest)
441439
442440-- | Parse contents of 'str' using 'parser' and return result.
443−parseFromString :: (Monad m, Stream s m Char, IsString s)
441+parseFromString :: (Stream s m Char, IsString s)
444442 => ParserT s st m r
445443 -> String
446444 -> ParserT s st m r
@@ -458,7 +456,7 @@ parseFromString parser str = do
458456
459457-- | Like 'parseFromString' but specialized for 'ParserState'.
460458-- This resets 'stateLastStrPos', which is almost always what we want.
461−parseFromString' :: (Monad m, Stream s m Char, IsString s)
459+parseFromString' :: (Stream s m Char, IsString s)
462460 => ParserT s ParserState m a
463461 -> String
464462 -> ParserT s ParserState m a
@@ -1019,7 +1017,7 @@ gridTableFooter = blanklines
10191017---
10201018
10211019-- | Removes the ParsecT layer from the monad transformer stack
1022−readWithM :: (Monad m, Stream s m Char, ToString s)
1020+readWithM :: (Stream s m Char, ToString s)
10231021 => ParserT s st m a -- ^ parser
10241022 -> st -- ^ initial state
10251023 -> s -- ^ input
@@ -1410,7 +1408,7 @@ extractIdClass (ident, cls, kvs) = (ident', cls', kvs')
14101408 Nothing -> cls
14111409 kvs' = filter (\(k,_) -> k /= "id" || k /= "class") kvs
14121410
1413−insertIncludedFile' :: (PandocMonad m, HasIncludeFiles st, Monad mf)
1411+insertIncludedFile' :: (PandocMonad m, HasIncludeFiles st)
14141412 => ParserT [a] st m (mf Blocks)
14151413 -> (String -> [a])
14161414 -> [FilePath] -> FilePath
src/Text/Pandoc/Readers/HTML.hs+2−2
@@ -435,7 +435,7 @@ eSection = try $ do
435435 TagOpen tag _ <- lookAhead $ pSatisfy sectTag
436436 setInChapter (pInTags tag block)
437437
438−headerLevel :: PandocMonad m => Text -> TagParser m Int
438+headerLevel :: Text -> TagParser m Int
439439headerLevel tagtype =
440440 case safeRead (T.unpack (T.drop 1 tagtype)) of
441441 Just level ->
@@ -1129,7 +1129,7 @@ _ `closes` _ = False
11291129--- parsers for use in markdown, textile readers
11301130
11311131-- | Matches a stretch of HTML in balanced tags.
1132−htmlInBalanced :: (HasReaderOptions st, Monad m)
1132+htmlInBalanced :: Monad m
11331133 => (Tag String -> Bool)
11341134 -> ParserT String st m String
11351135htmlInBalanced f = try $ do
src/Text/Pandoc/Readers/Ipynb.hs+1−1
@@ -53,7 +53,7 @@ readIpynb opts t = do
5353 Right (notebook3 :: Notebook NbV3) -> notebookToPandoc opts notebook3
5454 Left err -> throwError $ PandocIpynbDecodingError err
5555
56−notebookToPandoc :: (PandocMonad m, FromJSON (Notebook a))
56+notebookToPandoc :: PandocMonad m
5757 => ReaderOptions -> Notebook a -> m Pandoc
5858notebookToPandoc opts notebook = do
5959 let cells = notebookCells notebook
src/Text/Pandoc/Readers/LaTeX.hs+1−1
@@ -1379,7 +1379,7 @@ doref cls = do
13791379 ""
13801380 (inBrackets $ str refstr)
13811381
1382−lookupListDefault :: (Show k, Ord k) => v -> [k] -> M.Map k v -> v
1382+lookupListDefault :: (Ord k) => v -> [k] -> M.Map k v -> v
13831383lookupListDefault d = (fromMaybe d .) . lookupList
13841384 where lookupList l m = msum $ map (`M.lookup` m) l
13851385
src/Text/Pandoc/Readers/Man.hs+1−2
@@ -323,8 +323,7 @@ parseItalic [] = do
323323parseItalic args = return $
324324 emph $ mconcat $ intersperse B.space $ map linePartsToInlines args
325325
326−parseAlternatingFonts :: PandocMonad m
327− => [Inlines -> Inlines]
326+parseAlternatingFonts :: [Inlines -> Inlines]
328327 -> [Arg]
329328 -> ManParser m Inlines
330329parseAlternatingFonts constructors args = return $ mconcat $
src/Text/Pandoc/Readers/Org/Blocks.hs+1−1
@@ -772,7 +772,7 @@ bulletList = try $ do
772772 fmap (B.bulletList . compactify) . sequence
773773 <$> many1 (listItem (bulletListStart `indented` indent))
774774
775−indented :: Monad m => OrgParser m Int -> Int -> OrgParser m Int
775+indented :: OrgParser m Int -> Int -> OrgParser m Int
776776indented indentedMarker minIndent = try $ do
777777 n <- indentedMarker
778778 guard (minIndent <= n)
src/Text/Pandoc/Readers/TikiWiki.hs+2−2
@@ -54,10 +54,10 @@ type TikiWikiParser = ParserT [Char] ParserState
5454-- utility functions
5555--
5656
57−tryMsg :: PandocMonad m => String -> TikiWikiParser m a -> TikiWikiParser m a
57+tryMsg :: String -> TikiWikiParser m a -> TikiWikiParser m a
5858tryMsg msg p = try p <?> msg
5959
60−skip :: PandocMonad m => TikiWikiParser m a -> TikiWikiParser m ()
60+skip :: TikiWikiParser m a -> TikiWikiParser m ()
6161skip parser = Control.Monad.void parser
6262
6363nested :: PandocMonad m => TikiWikiParser m a -> TikiWikiParser m a
src/Text/Pandoc/Writers/Shared.hs+3−3
@@ -63,7 +63,7 @@ import Text.Pandoc.XML (escapeStringForXML)
6363-- Variables overwrite metadata fields with the same names.
6464-- If multiple variables are set with the same name, a list is
6565-- assigned. Does nothing if 'writerTemplate' is Nothing.
66−metaToJSON :: (Functor m, Monad m, ToJSON a)
66+metaToJSON :: (Monad m, ToJSON a)
6767 => WriterOptions
6868 -> ([Block] -> m a)
6969 -> ([Inline] -> m a)
@@ -76,7 +76,7 @@ metaToJSON opts blockWriter inlineWriter meta
7676
7777-- | Like 'metaToJSON', but does not include variables and is
7878-- not sensitive to 'writerTemplate'.
79−metaToJSON' :: (Functor m, Monad m, ToJSON a)
79+metaToJSON' :: (Monad m, ToJSON a)
8080 => ([Block] -> m a)
8181 -> ([Inline] -> m a)
8282 -> Meta
@@ -99,7 +99,7 @@ addVariablesToJSON opts metadata =
9999 where combineMetadata (Object o1) (Object o2) = Object $ H.union o1 o2
100100 combineMetadata x _ = x
101101
102−metaValueToJSON :: (Functor m, Monad m, ToJSON a)
102+metaValueToJSON :: (Monad m, ToJSON a)
103103 => ([Block] -> m a)
104104 -> ([Inline] -> m a)
105105 -> MetaValue
test/Tests/Lua.hs+1−1
@@ -192,7 +192,7 @@ assertFilterConversion msg filterPath docIn expectedDoc = do
192192roundtripEqual :: (Eq a, Lua.Peekable a, Lua.Pushable a) => a -> IO Bool
193193roundtripEqual x = (x ==) <$> roundtripped
194194 where
195− roundtripped :: (Lua.Peekable a, Lua.Pushable a) => IO a
195+ roundtripped :: Lua.Peekable a => IO a
196196 roundtripped = runLuaTest $ do
197197 oldSize <- Lua.gettop
198198 Lua.push x