diff options
author | Alberto Ruiz <aruiz@um.es> | 2009-05-09 11:08:40 +0000 |
---|---|---|
committer | Alberto Ruiz <aruiz@um.es> | 2009-05-09 11:08:40 +0000 |
commit | edabccf9d9564573359ebf795f4ce9cce7b15816 (patch) | |
tree | e23e04713ff7ecf13cbb09d866989cdbe15c996b /examples/error.hs | |
parent | 38d7b765f024b1f1aa42daf8b94050e43383ebec (diff) |
catching error example
Diffstat (limited to 'examples/error.hs')
-rw-r--r-- | examples/error.hs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/error.hs b/examples/error.hs new file mode 100644 index 0000000..f13a48e --- /dev/null +++ b/examples/error.hs | |||
@@ -0,0 +1,20 @@ | |||
1 | import Numeric.GSL | ||
2 | import Numeric.LinearAlgebra | ||
3 | import Prelude hiding (catch) | ||
4 | import Control.Exception | ||
5 | |||
6 | test x = catch | ||
7 | (print x) | ||
8 | (\e -> putStrLn $ "captured ["++ show (e :: SomeException) ++"]") | ||
9 | |||
10 | main = do | ||
11 | setErrorHandlerOff | ||
12 | |||
13 | test $ log_e (-1) | ||
14 | test $ 5 + (fst.exp_e) 1000 | ||
15 | test $ bessel_zero_Jnu_e (-0.3) 2 | ||
16 | |||
17 | test $ (linearSolve 0 4 :: Matrix Double) | ||
18 | test $ (linearSolve 5 (sqrt (-1)) :: Matrix Double) | ||
19 | |||
20 | putStrLn "Bye" \ No newline at end of file | ||