Commits

Sergey Astanin  committed 31a1e0e

Trace only when compiled with -fdebug.

  • Participants
  • Parent commits 29fc39f

Comments (0)

Files changed (2)

+{-# LANGUAGE CPP #-}
 module Utils where
 
 import Codec.Binary.UTF8.String (encodeString)
 liftT2 f (x,y,z) (x',y',z') = (f x x', f y y', f z z')
 
 dbg :: String -> Bool
+#ifdef DEBUG
 dbg msg = trace (encodeString msg) False
+#else
+dbg _ = False
+#endif
 
 trace' :: (Show a) => a -> a
+#ifdef DEBUG
 trace' x = trace (show x) x
+#else
+trace' = id
+#endif
 
 showL :: String -> [String] -> String
 showL "" xs = "[" ++ (intercalate ", " xs) ++ "]"
 stub :: anytype
 stub = undefined
 
-

File snusmumrik.cabal

 Executable snus
   Main-is:     snus.hs
   Extra-Libraries: zip
+  Build-Tools:  cpphs
+  Extensions:   CPP
+  GHC-Options:  -pgmPcpphs -optP--cpp
   Build-depends:
                  haskell98
                , base >= 3 && < 5
 Executable mumrik
   Main-is:     mumrik.hs
   Extra-Libraries: zip
-  GHC-Options:   -threaded
+  Build-Tools:  cpphs
+  Extensions:   CPP
+  GHC-Options:   -threaded -pgmPcpphs -optP--cpp
   Build-depends:
                  haskell98
                , base >= 3 && < 5