summaryrefslogtreecommitdiff
path: root/dev-haskell/cmdlib/files/cmdlib-0.3.4-ghc-6.12.patch
blob: 85a19d9aff0251665f68bb3531405de18ec8b6ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
--- cmdlib-0.3.4-orig/System/Console/CmdLib/Command.hs	2011-10-07 07:19:48.000000000 +1100
+++ cmdlib-0.3.4/System/Console/CmdLib/Command.hs	2012-01-06 20:49:59.668959773 +1100
@@ -225,6 +225,13 @@
 commandGroup :: (Commands a) => String -> a -> [CommandWrap]
 commandGroup s l = [CommandGroup s (toCommands l)]
 
+#if !MIN_VERSION_mtl(2,0,0)
+instance Monad (Either e) where
+        return = Right
+        Left  l >>= _ = Left l
+        Right r >>= k = k r    
+#endif
+
 -- TODO: disambiguation, hidden commands (aliases)
 findCommand :: String -> [CommandWrap] -> [CommandWrap]
 findCommand key list = case accum list of Left x -> [x]