summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Internal/Common.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Data/Packed/Internal/Common.hs')
-rw-r--r--lib/Data/Packed/Internal/Common.hs14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Data/Packed/Internal/Common.hs b/lib/Data/Packed/Internal/Common.hs
index 7305d8c..72a7e26 100644
--- a/lib/Data/Packed/Internal/Common.hs
+++ b/lib/Data/Packed/Internal/Common.hs
@@ -73,7 +73,7 @@ app4 f w1 o1 w2 o2 w3 o3 w4 o4 s = ww4 w1 o1 w2 o2 w3 o3 w4 o4 $
73 73
74-- GSL error codes are <= 1024 74-- GSL error codes are <= 1024
75-- | error codes for the auxiliary functions required by the wrappers 75-- | error codes for the auxiliary functions required by the wrappers
76errorCode :: Int -> String 76errorCode :: CInt -> String
77errorCode 2000 = "bad size" 77errorCode 2000 = "bad size"
78errorCode 2001 = "bad function code" 78errorCode 2001 = "bad function code"
79errorCode 2002 = "memory problem" 79errorCode 2002 = "memory problem"
@@ -85,7 +85,7 @@ errorCode 2007 = "not yet supported in this OS"
85errorCode n = "code "++show n 85errorCode n = "code "++show n
86 86
87-- | check the error code 87-- | check the error code
88check :: String -> IO Int -> IO () 88check :: String -> IO CInt -> IO ()
89check msg f = do 89check msg f = do
90 err <- f 90 err <- f
91 when (err/=0) $ if err > 1024 91 when (err/=0) $ if err > 1024
@@ -97,7 +97,7 @@ check msg f = do
97 return () 97 return ()
98 98
99-- | description of GSL error codes 99-- | description of GSL error codes
100foreign import ccall "auxi.h gsl_strerror" gsl_strerror :: Int -> IO (Ptr CChar) 100foreign import ccall "auxi.h gsl_strerror" gsl_strerror :: CInt -> IO (Ptr CChar)
101 101
102 102
103{- | conversion of Haskell functions into function pointers that can be used in the C side 103{- | conversion of Haskell functions into function pointers that can be used in the C side
@@ -112,10 +112,10 @@ foreign import ccall "wrapper" mkfun:: (Double -> Ptr() -> Double) -> IO( FunPtr
112------------------------------------------------ 112------------------------------------------------
113type PD = Ptr Double -- 113type PD = Ptr Double --
114type PC = Ptr (Complex Double) -- 114type PC = Ptr (Complex Double) --
115type TV = Int -> PD -> IO Int -- 115type TV = Int -> PD -> IO CInt --
116type TVV = Int -> PD -> TV -- 116type TVV = Int -> PD -> TV --
117type TVVV = Int -> PD -> TVV -- 117type TVVV = Int -> PD -> TVV --
118type TM = Int -> Int -> PD -> IO Int -- 118type TM = Int -> Int -> PD -> IO CInt --
119type TMM = Int -> Int -> PD -> TM -- 119type TMM = Int -> Int -> PD -> TM --
120type TMMM = Int -> Int -> PD -> TMM -- 120type TMMM = Int -> Int -> PD -> TMM --
121type TVM = Int -> PD -> TM -- 121type TVM = Int -> PD -> TM --
@@ -123,7 +123,7 @@ type TVVM = Int -> PD -> TVM --
123type TMV = Int -> Int -> PD -> TV -- 123type TMV = Int -> Int -> PD -> TV --
124type TMVM = Int -> Int -> PD -> TVM -- 124type TMVM = Int -> Int -> PD -> TVM --
125type TMMVM = Int -> Int -> PD -> TMVM -- 125type TMMVM = Int -> Int -> PD -> TMVM --
126type TCM = Int -> Int -> PC -> IO Int -- 126type TCM = Int -> Int -> PC -> IO CInt --
127type TCVCM = Int -> PC -> TCM -- 127type TCVCM = Int -> PC -> TCM --
128type TCMCVCM = Int -> Int -> PC -> TCVCM -- 128type TCMCVCM = Int -> Int -> PC -> TCVCM --
129type TMCMCVCM = Int -> Int -> PD -> TCMCVCM -- 129type TMCMCVCM = Int -> Int -> PD -> TCMCVCM --
@@ -133,7 +133,7 @@ type TVCM = Int -> PD -> TCM --
133type TCMVCM = Int -> Int -> PC -> TVCM -- 133type TCMVCM = Int -> Int -> PC -> TVCM --
134type TCMCMVCM = Int -> Int -> PC -> TCMVCM -- 134type TCMCMVCM = Int -> Int -> PC -> TCMVCM --
135type TCMCMCM = Int -> Int -> PC -> TCMCM -- 135type TCMCMCM = Int -> Int -> PC -> TCMCM --
136type TCV = Int -> PC -> IO Int -- 136type TCV = Int -> PC -> IO CInt --
137type TCVCV = Int -> PC -> TCV -- 137type TCVCV = Int -> PC -> TCV --
138type TCVCVCV = Int -> PC -> TCVCV -- 138type TCVCVCV = Int -> PC -> TCVCV --
139type TCMCV = Int -> Int -> PC -> TCV -- 139type TCMCV = Int -> Int -> PC -> TCV --