Thanks John. I'll try it out, along with Kmett's exceptions package I just
found:
http://hackage.haskell.org/packages/archive/exceptions/0.1.1/doc/html/Control-Monad-Catch.html
I noticed on an issue for lens (https://github.com/ekmett/lens/issues/301)
they switched to this since MonadCatchIO is
I don't think there's anything necessarily wrong with ekmett's exceptions
package, but you should be aware that it may not do what you expect:
module Foo where
import Control.Monad.IO.Class
import Control.Monad.Catch
import Control.Exception (ArithException)
f :: CatchT IO String
f = catch
On Thursday 18 July 2013 23:05:33 Eric Rasmussen wrote:
[…]
Would there be any interest in cleaning that up and adding it (or something
similar) to Control.Monad.CatchIO?
[…]
MonadCatchIO-transformers is being deprecated, as recently GHC has removed the
'block' and 'unblock' functions,
Arie,
Thanks for calling that out. The most useful part for my case is the
MonadCatchIO implementation of catch:
catch :: Exception e = m a - (e - m a) - m a
Hoogle shows a few similar functions for that type signature, but they
won't work for the case of catching an IOException in an arbitrary
I think most people use monad-control these days for catching exceptions in
monad stacks (http://hackage.haskell.org/package/monad-control-0.3.2.1).
The very convenient lifted-base package (
http://hackage.haskell.org/package/lifted-base) depends on it and exports a
function
://hackage.haskell.org/package/MonadCatchIO-transformers
2013/7/18 Eric Rasmussen ericrasmus...@gmail.com
Hello,
I am writing a small application that uses a monad transformer stack, and
I'm looking for advice on the best way to handle IO errors. Ideally I'd
like to be able to perform an action
Hello,
I am writing a small application that uses a monad transformer stack, and
I'm looking for advice on the best way to handle IO errors. Ideally I'd
like to be able to perform an action (such as readFile
file_that_does_not_exist), catch the IOError, and then convert it to a
string error
to handle IO errors. Ideally I'd
like to be able to perform an action (such as readFile
file_that_does_not_exist), catch the IOError, and then convert it to a
string error in MonadError. Here's an example of what I'm doing now:
{-# LANGUAGE FlexibleContexts #-}
import Control.Monad.Error
import
way to handle IO errors. Ideally I'd like to
be able to perform an action (such as readFile file_that_does_not_exist),
catch the IOError, and then convert it to a string error in MonadError.
Here's an example of what I'm doing now:
{-# LANGUAGE FlexibleContexts #-}
import
A quick look at the source looks like both GHC and NHC will
simply pass
on errors from the OS, so for example with
module Main where
import IO
import Directory
main :: IO()
main = do catch (createDirectory this/does/not/exist/foo)
(\e -
| Two possibilities: either createDirectory should act like
| 'mkdir -p' and make the whole path, or the library report
| should document isDoesNotExistError as a possible error
| thrown by createDirectory. I'd vote for the latter.
I'm willing to do that for H98 unless anyone can think of a
Hi guys,
Me again I'm afraid...
A quick look at the source looks like both GHC and NHC will simply pass
on errors from the OS, so for example with
module Main where
import IO
import Directory
main :: IO()
main = do catch (createDirectory this/does/not/exist/foo)
Can anyone tell me why this behaves as it does? In Hugs, I get
C:\My Documents\functional\ldapsck1\buffer.hs
Main main
Illegal operation
(561 reductions, 1029 cells)
Main
If the input file is the one line:
1234567812345678
the output file is:
Starting logging
1234567812345678
Error
In
13:03:00
To: Dominic Steinitz
haskell
cc:
bcc:
Subject:RE: IO Errors
In ghc, the program hangs without even creating a file.
With GHC 5.00.1 here it creates the output file containing:
Starting logging
1234567812345678
Finishing logging
which GHC version was hanging for you
14 matches
Mail list logo