summaryrefslogtreecommitdiff
path: root/lib/Data/Packed
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Data/Packed')
-rw-r--r--lib/Data/Packed/Internal/Vector.hs10
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)
41infixl 0 // 41infixl 0 //
42(//) = flip ($) 42(//) = flip ($)
43 43
44errorCode 1000 = "bad size"
45errorCode 1001 = "bad function code"
46errorCode 1002 = "memory problem"
47errorCode 1003 = "bad file"
48errorCode 1004 = "singular"
49errorCode 1005 = "didn't converge"
50errorCode n = "code "++show n
51
44check msg ls f = do 52check 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