Author: Joachim Breitner --- a/Control/Monad/Logger.hs +++ b/Control/Monad/Logger.hs @@ -96,6 +96,8 @@ module Control.Monad.Logger #if WITH_TEMPLATE_HASKELL import Language.Haskell.TH.Syntax (Lift (lift), Q, Exp, Loc (..), qLocation) +#else +import Language.Haskell.TH.Syntax (Loc (..)) #endif import Data.Monoid (Monoid) @@ -188,16 +190,6 @@ instance Lift LogLevel where lift LevelError = [|LevelError|] lift (LevelOther x) = [|LevelOther $ pack $(lift $ unpack x)|] -#else - -data Loc - = Loc { loc_filename :: String - , loc_package :: String - , loc_module :: String - , loc_start :: CharPos - , loc_end :: CharPos } -type CharPos = (Int, Int) - #endif -- | A @Monad@ which has the ability to log messages in some manner. --- a/monad-logger.cabal +++ b/monad-logger.cabal @@ -44,13 +44,11 @@ library , bytestring , blaze-builder , exceptions + , template-haskell if impl(ghc >= 8.0.1) cpp-options: -DWITH_CALLSTACK exposed-modules: Control.Monad.Logger.CallStack if flag(template_haskell) - build-depends: template-haskell - - if flag(template_haskell) cpp-options: -DWITH_TEMPLATE_HASKELL