diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2017-08-23 09:43:49 +0200 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2017-08-23 09:43:49 +0200 |
commit | f8dce4a9e3a51f77597da20892fad2ca79879005 (patch) | |
tree | e236a30315520c04b821a417f12ad84c542e2bea /src | |
parent | 9930e8582dbe6f34cb37e381ace2ef9fbbac957d (diff) | |
download | pandoc-f8dce4a9e3a51f77597da20892fad2ca79879005.tar.gz |
Text.Pandoc.Lua: fix fallback functions with GHC 7.8
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Lua.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Lua.hs b/src/Text/Pandoc/Lua.hs index 6c6676e4f..d6e5def4a 100644 --- a/src/Text/Pandoc/Lua.hs +++ b/src/Text/Pandoc/Lua.hs @@ -35,7 +35,7 @@ module Text.Pandoc.Lua (LuaException (..), pushPandocModule, runLuaFilter) where import Control.Monad (mplus, unless, when, (>=>)) import Control.Monad.Trans (MonadIO (..)) import Data.Data (DataType, Data, toConstr, showConstr, dataTypeOf, - dataTypeConstrs, dataTypeName) + dataTypeConstrs, dataTypeName, tyconUQname) import Data.Foldable (foldrM) import Data.Map (Map) import Data.Maybe (isJust) @@ -127,7 +127,7 @@ newtype LuaFilterFunction = LuaFilterFunction { functionIndex :: Int } tryFilter :: (Data a, FromLuaStack a, ToLuaStack a) => FunctionMap -> a -> Lua a tryFilter fnMap x = let filterFnName = showConstr (toConstr x) - catchAllName = dataTypeName (dataTypeOf x) + catchAllName = tyconUQname $ dataTypeName (dataTypeOf x) in case Map.lookup filterFnName fnMap `mplus` Map.lookup catchAllName fnMap of Just fn -> runFilterFunction fn x |