Re: [Haskell-cafe] Catching string from error function with GHC Control.Exception

2006-01-03 Thread Iain Alexander
I've just been through the process of converting some code from using Control.Exception to using an Error monad, and I would recommend that as a more straightforward and manageable alternative, unless you need Control.Exception for other reasons. I started by changing my potentially-failing fun

Re: [Haskell-cafe] Catching string from error function with GHC Control.Exception

2006-01-01 Thread Cale Gibbard
On 01/01/06, Andrew Savige <[EMAIL PROTECTED]> wrote: > I am a Haskell beginner, using GHC 6.4.1. > > Suppose I have a function, tt, say, which may call error. > For the purposes of testing tt, I'd like to be able to catch > the error string and assert that it matches the expected error > string. I

[Haskell-cafe] Catching string from error function with GHC Control.Exception

2006-01-01 Thread Andrew Savige
I am a Haskell beginner, using GHC 6.4.1. Suppose I have a function, tt, say, which may call error. For the purposes of testing tt, I'd like to be able to catch the error string and assert that it matches the expected error string. Is HUnit or QuickCheck (or either) the appropriate tool for this s