packages feed

simple-log 0.8.0 → 0.8.1

raw patch · 2 files changed

+16/−3 lines, 2 filesdep ~base

Dependency ranges changed: base

Files

simple-log.cabal view
@@ -1,5 +1,5 @@ Name:                 simple-log
-Version:              0.8.0
+Version:              0.8.1
 Synopsis:             Simple log for Haskell
 Description:          Log library for Haskell with removing unnecessary traces
 License:              BSD3
@@ -57,7 +57,7 @@   default-language: Haskell2010
   default-extensions: UnicodeSyntax
   build-depends:
-    base >= 4.9 && < 6,
+    base >= 4.0 && < 6,
     simple-log,
     hspec >= 2.3 && < 2.5,
     text >= 0.11.0 && < 2.0.0
src/System/Log/Simple/Monad.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE OverloadedStrings, FlexibleInstances, UndecidableInstances, MultiParamTypeClasses, GeneralizedNewtypeDeriving, ConstraintKinds, FlexibleContexts #-}
+{-# LANGUAGE OverloadedStrings, FlexibleInstances, UndecidableInstances, MultiParamTypeClasses, GeneralizedNewtypeDeriving, ConstraintKinds, FlexibleContexts, CPP, ImplicitParams #-}
 
 module System.Log.Simple.Monad (
 	-- | Monad log
@@ -18,7 +18,9 @@ import Prelude hiding (log)
 import Prelude.Unicode
 
+#if __GLASGOW_HASKELL__ >= 800
 import Control.Exception (SomeException)
+#endif
 import Control.Monad.IO.Class
 import Control.Monad.Morph
 import Control.Monad.Reader
@@ -85,6 +87,17 @@ -- | Create local scope
 scope_ ∷ MonadLog m ⇒ Text → m a → m a
 scope_ s = localLog (subLog mempty (read ∘ T.unpack $ s))
+
+
+#if __GLASGOW_HASKELL__ < 800
+type HasCallStack = ?callStack ∷ CallStack
+
+callStack ∷ HasCallStack ⇒ CallStack
+callStack = ?callStack
+
+prettyCallStack ∷ CallStack → String
+prettyCallStack = showCallStack
+#endif
 
 -- | Scope with log all exceptions
 scope ∷ MonadLog m ⇒ Text → m a → m a