diff options
Diffstat (limited to 'Text')
-rw-r--r-- | Text/Pandoc/Definition.hs | 22 | ||||
-rw-r--r-- | Text/Pandoc/Plugins.hs | 4 |
2 files changed, 13 insertions, 13 deletions
diff --git a/Text/Pandoc/Definition.hs b/Text/Pandoc/Definition.hs index ed58f6b75..92ce094d4 100644 --- a/Text/Pandoc/Definition.hs +++ b/Text/Pandoc/Definition.hs @@ -129,22 +129,22 @@ data Inline deriving (Show, Eq, Read, Typeable, Data) -- | Applies a transformation on @a@s to matching elements in a @b@. -processIn :: (Data a, Data b) => (a -> a) -> b -> b -processIn f = everywhere (mkT f) +processWith :: (Data a, Data b) => (a -> a) -> b -> b +processWith f = everywhere (mkT f) --- | Like 'processIn', but with monadic transformations. -processInM :: (Monad m, Data a, Data b) => (a -> m a) -> b -> m b -processInM f = everywhereM (mkM f) +-- | Like 'processWith', but with monadic transformations. +processWithM :: (Monad m, Data a, Data b) => (a -> m a) -> b -> m b +processWithM f = everywhereM (mkM f) -- | Runs a query on matching @a@ elements in a @c@. -queryIn :: (Data a, Data c) => (a -> [b]) -> c -> [b] -queryIn f = everything (++) ([] `mkQ` f) +queryWith :: (Data a, Data c) => (a -> [b]) -> c -> [b] +queryWith f = everything (++) ([] `mkQ` f) -{-# DEPRECATED processPandoc "Use processIn instead" #-} +{-# DEPRECATED processPandoc "Use processWith instead" #-} processPandoc :: Data a => (a -> a) -> Pandoc -> Pandoc -processPandoc = processIn +processPandoc = processWith -{-# DEPRECATED queryPandoc "Use queryIn instead" #-} +{-# DEPRECATED queryPandoc "Use queryWith instead" #-} queryPandoc :: Data a => (a -> [b]) -> Pandoc -> [b] -queryPandoc = queryIn +queryPandoc = queryWith diff --git a/Text/Pandoc/Plugins.hs b/Text/Pandoc/Plugins.hs index 5ba333faa..cb8ad1e11 100644 --- a/Text/Pandoc/Plugins.hs +++ b/Text/Pandoc/Plugins.hs @@ -65,5 +65,5 @@ evaluatePlugin modsrc = do throwError $ UnknownError $ "The plugin module must define a function 'transform'." transformType <- typeOf "transform" if "-> IO" `isInfixOf` transformType - then interpret "processInM transform" (as :: Pandoc -> IO Pandoc) - else interpret "return . (processIn transform)" (as :: Pandoc -> IO Pandoc) + then interpret "processWithM transform" (as :: Pandoc -> IO Pandoc) + else interpret "return . (processWith transform)" (as :: Pandoc -> IO Pandoc) |