diff options
author | jao <jao@gnu.org> | 2014-10-11 20:21:38 +0200 |
---|---|---|
committer | jao <jao@gnu.org> | 2014-10-11 20:22:10 +0200 |
commit | 98938f15c39baaaff52d70606dfba49c4bb854b5 (patch) | |
tree | e65ad89776e219c6f385aac1677cfd83c588e141 | |
parent | ee0c2639f99a4f8ee422b3d0b52323f887d0a9ec (diff) | |
download | xmobar-98938f15c39baaaff52d70606dfba49c4bb854b5.tar.gz xmobar-98938f15c39baaaff52d70606dfba49c4bb854b5.tar.bz2 |
Compatibility with mtl 2.1
Thanks to Apollon Oikonomopoulos!!
-rw-r--r-- | src/Bitmap.hs | 13 | ||||
-rw-r--r-- | src/XPMFile.hsc | 4 | ||||
-rw-r--r-- | xmobar.cabal | 3 |
3 files changed, 18 insertions, 2 deletions
diff --git a/src/Bitmap.hs b/src/Bitmap.hs index 63baf6a..ec99ad8 100644 --- a/src/Bitmap.hs +++ b/src/Bitmap.hs @@ -18,7 +18,6 @@ module Bitmap import Control.Applicative((<|>)) import Control.Monad -import Control.Monad.Except(MonadError(..), runExceptT) import Control.Monad.Trans(MonadIO(..)) import Data.Map hiding (foldr, map, filter) import Graphics.X11.Xlib @@ -33,6 +32,18 @@ import Actions (Action) import XPMFile(readXPMFile) #endif +#if MIN_VERSION_mtl(2, 2, 1) +import Control.Monad.Except(MonadError(..), runExceptT) + +#else +import Control.Monad.Error(MonadError(..)) +import Control.Monad.Trans.Error(ErrorT, runErrorT) + +runExceptT :: ErrorT e m a -> m (Either e a) +runExceptT = runErrorT + +#endif + data BitmapType = Mono Pixel | Poly data Bitmap = Bitmap { width :: Dimension diff --git a/src/XPMFile.hsc b/src/XPMFile.hsc index 18c7dec..f10449b 100644 --- a/src/XPMFile.hsc +++ b/src/XPMFile.hsc @@ -13,7 +13,11 @@ module XPMFile(readXPMFile) where +#if MIN_VERSION_mtl(2, 2, 1) import Control.Monad.Except(MonadError(..)) +#else +import Control.Monad.Error(MonadError(..)) +#endif import Control.Monad.Trans(MonadIO(..)) import Graphics.X11.Xlib(Dimension, Display(..), Drawable, Pixmap) import Foreign.C.String(CString, withCString) diff --git a/xmobar.cabal b/xmobar.cabal index 469e45c..fe500f1 100644 --- a/xmobar.cabal +++ b/xmobar.cabal @@ -110,8 +110,9 @@ executable xmobar unix, time, filepath, + transformers, X11 >= 1.6.1, - mtl >= 2.2.1 && < 2.3, + mtl >= 2.1 && < 2.3, parsec == 3.1.*, HTTP >= 4000, stm >= 2.3 && < 2.5 |