Text.Pandoc.Lua: fix fallback functions with GHC 7.8
This commit is contained in:
parent
9930e8582d
commit
f8dce4a9e3
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue