add instance MonadError () Maybe
authorobadz <obadz-git@obadz.com>
Tue, 7 Jun 2016 23:39:19 +0000 (00:39 +0100)
committerobadz <obadz-git@obadz.com>
Tue, 7 Jun 2016 23:39:19 +0000 (00:39 +0100)
Control/Monad/Error/Class.hs

index 4b8d8fe..66c1354 100644 (file)
@@ -106,6 +106,11 @@ instance MonadError IOException IO where
     throwError = ioError
     catchError = catch
 
+instance MonadError () Maybe where
+    throwError ()        = Nothing
+    catchError Nothing f = f ()
+    catchError x       _ = x
+
 -- ---------------------------------------------------------------------------
 -- Our parameterizable error monad