summaryrefslogtreecommitdiffhomepage
path: root/src/Bitmap.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Bitmap.hs')
-rw-r--r--src/Bitmap.hs13
1 files changed, 12 insertions, 1 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