From 70dc5834da16680caedef4727b1d7f335f0b5427 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Mon, 18 Dec 2017 14:24:16 +0100 Subject: Lua filters: perform minor code clean-up Change: minor --- src/Text/Pandoc/Lua/PandocModule.hs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/Text/Pandoc/Lua/PandocModule.hs') diff --git a/src/Text/Pandoc/Lua/PandocModule.hs b/src/Text/Pandoc/Lua/PandocModule.hs index 75f884c46..6bc2618fd 100644 --- a/src/Text/Pandoc/Lua/PandocModule.hs +++ b/src/Text/Pandoc/Lua/PandocModule.hs @@ -71,16 +71,13 @@ pushPandocModule datadir = do return 1 walkElement :: (ToLuaStack a, Walkable [Inline] a, Walkable [Block] a) - => a -> LuaFilter -> Lua NumResults -walkElement x f = do - x' <- walkInlines f x >>= walkBlocks f - Lua.push x' - return 1 + => a -> LuaFilter -> Lua a +walkElement x f = walkInlines f x >>= walkBlocks f -walkInline :: Inline -> LuaFilter -> Lua NumResults +walkInline :: Inline -> LuaFilter -> Lua Inline walkInline = walkElement -walkBlock :: Block -> LuaFilter -> Lua NumResults +walkBlock :: Block -> LuaFilter -> Lua Block walkBlock = walkElement readDoc :: String -> String -> Lua NumResults -- cgit v1.2.3