File: use-template-haskell-loc

package info (click to toggle)
haskell-monad-logger 0.3.20-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 144 kB
  • sloc: haskell: 611; makefile: 7
file content (47 lines) | stat: -rw-r--r-- 1,223 bytes parent folder | download
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
@@ -93,6 +93,8 @@
 
 #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)
@@ -185,16 +187,6 @@
     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 @@
                      , 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