summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal/Devel.hs
diff options
context:
space:
mode:
Diffstat (limited to 'packages/base/src/Internal/Devel.hs')
-rw-r--r--packages/base/src/Internal/Devel.hs21
1 files changed, 11 insertions, 10 deletions
diff --git a/packages/base/src/Internal/Devel.hs b/packages/base/src/Internal/Devel.hs
index f72d8aa..b0594d4 100644
--- a/packages/base/src/Internal/Devel.hs
+++ b/packages/base/src/Internal/Devel.hs
@@ -13,6 +13,7 @@ module Internal.Devel where
13 13
14 14
15import Control.Monad ( when ) 15import Control.Monad ( when )
16import Data.Int
16import Foreign.C.Types ( CInt ) 17import Foreign.C.Types ( CInt )
17--import Foreign.Storable.Complex () 18--import Foreign.Storable.Complex ()
18import Foreign.Ptr(Ptr) 19import Foreign.Ptr(Ptr)
@@ -28,7 +29,7 @@ infixl 0 //
28 29
29-- GSL error codes are <= 1024 30-- GSL error codes are <= 1024
30-- | error codes for the auxiliary functions required by the wrappers 31-- | error codes for the auxiliary functions required by the wrappers
31errorCode :: CInt -> String 32errorCode :: Int32 -> String
32errorCode 2000 = "bad size" 33errorCode 2000 = "bad size"
33errorCode 2001 = "bad function code" 34errorCode 2001 = "bad function code"
34errorCode 2002 = "memory problem" 35errorCode 2002 = "memory problem"
@@ -44,7 +45,7 @@ errorCode n = "code "++show n
44foreign import ccall unsafe "asm_finit" finit :: IO () 45foreign import ccall unsafe "asm_finit" finit :: IO ()
45 46
46-- | check the error code 47-- | check the error code
47check :: String -> IO CInt -> IO () 48check :: String -> IO Int32 -> IO ()
48check msg f = do 49check msg f = do
49-- finit 50-- finit
50 err <- f 51 err <- f
@@ -54,7 +55,7 @@ check msg f = do
54 55
55-- | postfix error code check 56-- | postfix error code check
56infixl 0 #| 57infixl 0 #|
57(#|) :: IO CInt -> String -> IO () 58(#|) :: IO Int32 -> String -> IO ()
58(#|) = flip check 59(#|) = flip check
59 60
60-- | Error capture and conversion to Maybe 61-- | Error capture and conversion to Maybe
@@ -65,12 +66,12 @@ mbCatch act = E.catch (Just `fmap` act) f
65 66
66-------------------------------------------------------------------------------- 67--------------------------------------------------------------------------------
67 68
68type CM b r = CInt -> CInt -> Ptr b -> r 69type CM b r = Int32 -> Int32 -> Ptr b -> r
69type CV b r = CInt -> Ptr b -> r 70type CV b r = Int32 -> Ptr b -> r
70type OM b r = CInt -> CInt -> CInt -> CInt -> Ptr b -> r 71type OM b r = Int32 -> Int32 -> Int32 -> Int32 -> Ptr b -> r
71 72
72type CIdxs r = CV CInt r 73type CIdxs r = CV Int32 r
73type Ok = IO CInt 74type Ok = IO Int32
74 75
75infixr 5 :>, ::>, ..> 76infixr 5 :>, ::>, ..>
76type (:>) t r = CV t r 77type (:>) t r = CV t r
@@ -87,8 +88,8 @@ class TransArray c
87 88
88instance Storable t => TransArray (Vector t) 89instance Storable t => TransArray (Vector t)
89 where 90 where
90 type Trans (Vector t) b = CInt -> Ptr t -> b 91 type Trans (Vector t) b = Int32 -> Ptr t -> b
91 type TransRaw (Vector t) b = CInt -> Ptr t -> b 92 type TransRaw (Vector t) b = Int32 -> Ptr t -> b
92 apply = avec 93 apply = avec
93 {-# INLINE apply #-} 94 {-# INLINE apply #-}
94 applyRaw = avec 95 applyRaw = avec