diff options
author | Joe Crayne <joe@jerkface.net> | 2019-08-08 02:22:30 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2019-08-08 22:47:46 -0400 |
commit | badcbdfddc4be31fc79a6df4553795af18069efe (patch) | |
tree | 90c38bd8793b53a5e6f00049eb78acaa8d88d711 /packages/base/src/Internal/Devel.hs | |
parent | d844a145f2e8808c9f75cd99c673d5f5c8960bf2 (diff) |
Removed the Element class.tower
Diffstat (limited to 'packages/base/src/Internal/Devel.hs')
-rw-r--r-- | packages/base/src/Internal/Devel.hs | 21 |
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 | ||
15 | import Control.Monad ( when ) | 15 | import Control.Monad ( when ) |
16 | import Data.Int | ||
16 | import Foreign.C.Types ( CInt ) | 17 | import Foreign.C.Types ( CInt ) |
17 | --import Foreign.Storable.Complex () | 18 | --import Foreign.Storable.Complex () |
18 | import Foreign.Ptr(Ptr) | 19 | import 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 |
31 | errorCode :: CInt -> String | 32 | errorCode :: Int32 -> String |
32 | errorCode 2000 = "bad size" | 33 | errorCode 2000 = "bad size" |
33 | errorCode 2001 = "bad function code" | 34 | errorCode 2001 = "bad function code" |
34 | errorCode 2002 = "memory problem" | 35 | errorCode 2002 = "memory problem" |
@@ -44,7 +45,7 @@ errorCode n = "code "++show n | |||
44 | foreign import ccall unsafe "asm_finit" finit :: IO () | 45 | foreign import ccall unsafe "asm_finit" finit :: IO () |
45 | 46 | ||
46 | -- | check the error code | 47 | -- | check the error code |
47 | check :: String -> IO CInt -> IO () | 48 | check :: String -> IO Int32 -> IO () |
48 | check msg f = do | 49 | check 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 |
56 | infixl 0 #| | 57 | infixl 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 | ||
68 | type CM b r = CInt -> CInt -> Ptr b -> r | 69 | type CM b r = Int32 -> Int32 -> Ptr b -> r |
69 | type CV b r = CInt -> Ptr b -> r | 70 | type CV b r = Int32 -> Ptr b -> r |
70 | type OM b r = CInt -> CInt -> CInt -> CInt -> Ptr b -> r | 71 | type OM b r = Int32 -> Int32 -> Int32 -> Int32 -> Ptr b -> r |
71 | 72 | ||
72 | type CIdxs r = CV CInt r | 73 | type CIdxs r = CV Int32 r |
73 | type Ok = IO CInt | 74 | type Ok = IO Int32 |
74 | 75 | ||
75 | infixr 5 :>, ::>, ..> | 76 | infixr 5 :>, ::>, ..> |
76 | type (:>) t r = CV t r | 77 | type (:>) t r = CV t r |
@@ -87,8 +88,8 @@ class TransArray c | |||
87 | 88 | ||
88 | instance Storable t => TransArray (Vector t) | 89 | instance 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 |