summaryrefslogtreecommitdiff
path: root/p/haskell-monad-logger/debian/patches/use-template-haskell-loc
blob: 137beb5faca60c77fde2b0b57b400eebf67bd8cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Author: Joachim Breitner <nomeata@debian.org>

--- 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