git.iko.soy/typeable/pandoc
on master help sign in
Remove Functor and Applicative constraints where Monad already exists
commit2f583dab9d72be4e8abfbbd9cdec9dc658f4ada1 authorAlexander Krotov <ilabdsf@gmail.com> dateThu 8 Nov 2018, 14:41 (8 years ago) parent846e231
1 file changed+7−14
src/Text/Pandoc/Parsing.hs+7−14
src/Text/Pandoc/Parsing.hs+7−14
@@ -869,8 +869,7 @@ lineBlockLines = try $ do
869869
870870-- | Parse a table using 'headerParser', 'rowParser',
871871-- 'lineParser', and 'footerParser'.
872−tableWith :: (Stream s m Char, HasReaderOptions st,
873− Functor mf, Applicative mf, Monad mf)
872+tableWith :: (Stream s m Char, HasReaderOptions st, Monad mf)
874873 => ParserT s st m (mf [Blocks], [Alignment], [Int])
875874 -> ([Int] -> ParserT s st m (mf [Blocks]))
876875 -> ParserT s st m sep
@@ -883,8 +882,7 @@ tableWith headerParser rowParser lineParser footerParser = try $ do
883882
884883type TableComponents mf = ([Alignment], [Double], mf [Blocks], mf [[Blocks]])
885884
886−tableWith' :: (Stream s m Char, HasReaderOptions st,
887− Functor mf, Applicative mf, Monad mf)
885+tableWith' :: (Stream s m Char, HasReaderOptions st, Monad mf)
888886 => ParserT s st m (mf [Blocks], [Alignment], [Int])
889887 -> ([Int] -> ParserT s st m (mf [Blocks]))
890888 -> ParserT s st m sep
@@ -931,8 +929,7 @@ widthsFromIndices numColumns' indices =
931929-- (which may be grid), then the rows,
932930-- which may be grid, separated by blank lines, and
933931-- ending with a footer (dashed line followed by blank line).
934−gridTableWith :: (Stream s m Char, HasReaderOptions st,
935− Functor mf, Applicative mf, Monad mf, IsString s)
932+gridTableWith :: (Stream s m Char, HasReaderOptions st, Monad mf, IsString s)
936933 => ParserT s st m (mf Blocks) -- ^ Block list parser
937934 -> Bool -- ^ Headerless table
938935 -> ParserT s st m (mf Blocks)
@@ -940,8 +937,7 @@ gridTableWith blocks headless =
940937 tableWith (gridTableHeader headless blocks) (gridTableRow blocks)
941938 (gridTableSep '-') gridTableFooter
942939
943−gridTableWith' :: (Stream s m Char, HasReaderOptions st,
944− Functor mf, Applicative mf, Monad mf, IsString s)
940+gridTableWith' :: (Stream s m Char, HasReaderOptions st, Monad mf, IsString s)
945941 => ParserT s st m (mf Blocks) -- ^ Block list parser
946942 -> Bool -- ^ Headerless table
947943 -> ParserT s st m (TableComponents mf)
@@ -980,8 +976,7 @@ gridTableSep :: Stream s m Char => Char -> ParserT s st m Char
980976gridTableSep ch = try $ gridDashedLines ch >> return '\n'
981977
982978-- | Parse header for a grid table.
983−gridTableHeader :: (Stream s m Char, Functor mf, Applicative mf, Monad mf,
984− IsString s)
979+gridTableHeader :: (Stream s m Char, Monad mf, IsString s)
985980 => Bool -- ^ Headerless table
986981 -> ParserT s st m (mf Blocks)
987982 -> ParserT s st m (mf [Blocks], [Alignment], [Int])
@@ -1014,8 +1009,7 @@ gridTableRawLine indices = do
10141009 return (gridTableSplitLine indices line)
10151010
10161011-- | Parse row of grid table.
1017−gridTableRow :: (Stream s m Char, Functor mf, Applicative mf, Monad mf,
1018− IsString s)
1012+gridTableRow :: (Stream s m Char, Monad mf, IsString s)
10191013 => ParserT s st m (mf Blocks)
10201014 -> [Int]
10211015 -> ParserT s st m (mf [Blocks])
@@ -1449,8 +1443,7 @@ extractIdClass (ident, cls, kvs) = (ident', cls', kvs')
14491443 Nothing -> cls
14501444 kvs' = filter (\(k,_) -> k /= "id" || k /= "class") kvs
14511445
1452−insertIncludedFile' :: (PandocMonad m, HasIncludeFiles st,
1453− Functor mf, Applicative mf, Monad mf)
1446+insertIncludedFile' :: (PandocMonad m, HasIncludeFiles st, Monad mf)
14541447 => ParserT [a] st m (mf Blocks)
14551448 -> (String -> [a])
14561449 -> [FilePath] -> FilePath