diff options
Diffstat (limited to 'lib/Data/Packed')
-rw-r--r-- | lib/Data/Packed/Internal/Vector.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs index 8f4e6a4..4836bdb 100644 --- a/lib/Data/Packed/Internal/Vector.hs +++ b/lib/Data/Packed/Internal/Vector.hs | |||
@@ -41,9 +41,17 @@ on f g = \x y -> f (g x) (g y) | |||
41 | infixl 0 // | 41 | infixl 0 // |
42 | (//) = flip ($) | 42 | (//) = flip ($) |
43 | 43 | ||
44 | errorCode 1000 = "bad size" | ||
45 | errorCode 1001 = "bad function code" | ||
46 | errorCode 1002 = "memory problem" | ||
47 | errorCode 1003 = "bad file" | ||
48 | errorCode 1004 = "singular" | ||
49 | errorCode 1005 = "didn't converge" | ||
50 | errorCode n = "code "++show n | ||
51 | |||
44 | check msg ls f = do | 52 | check msg ls f = do |
45 | err <- f | 53 | err <- f |
46 | when (err/=0) (error msg) | 54 | when (err/=0) (error (msg++": "++errorCode err)) |
47 | mapM_ (touchForeignPtr . fptr) ls | 55 | mapM_ (touchForeignPtr . fptr) ls |
48 | return () | 56 | return () |
49 | 57 | ||