Yuri Bochkarev committed 86725ab

[*] fix warnings, use new catch from Control.Exception

  • Participants
  • Parent commits 41e3e13

Comments (0)

Files changed (4)

File imagepaste.cabal

 Executable imagepaste
   Main-is:             Main.hs
-  Build-depends:       base == 4.*,
+  Build-depends:       base < 5,
-                       haskell98,

File src/Configuration.hs

 import qualified Data.Map as Map
 import qualified Text.JSON as J
+import qualified Control.Exception as C
 import System.Environment (getEnvironment)
 import System.IO (withFile)
 readConfigFile "" = return $ Just ""
 readConfigFile filename = do
   msgDebug $ "Reading config: " ++ show filename
-  catch (liftM Just $ readFile filename) (\_ -> return Nothing)
+  C.catch (liftM Just $ readFile filename) (\e -> let _ = e :: C.IOException
+                                                  in return Nothing)
 -- | Read files by given paths until valid config is read
 -- Empty filepath will cause to return default dummy valid config

File src/Proxy.hs

 import Network.URI (parseURI, nullURI)
 import Data.Maybe (fromMaybe)
+import qualified Control.Exception as C
 import qualified Configuration
 getProxyFromEnvironment :: IO Proxy
 getProxyFromEnvironment = do
-  proxy <- try (getEnv "HTTP_PROXY")
+  proxy <- C.try (getEnv "HTTP_PROXY") :: IO (Either C.IOException String)
   case proxy of
     Left _ -> return NoProxy
     Right p -> return $ Proxy p Nothing

File src/Runner.hs

 import qualified Data.Map as Map
 import qualified Data.List as List
-import qualified Maybe (maybe)
+import qualified Data.Maybe (maybe)
 import qualified Version
 import Log (msgDebug, msgInfo)