summaryrefslogtreecommitdiff
path: root/packages/sundials/src/Types.hs
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sundials/src/Types.hs')
-rw-r--r--packages/sundials/src/Types.hs14
1 files changed, 3 insertions, 11 deletions
diff --git a/packages/sundials/src/Types.hs b/packages/sundials/src/Types.hs
index 9654527..e910c57 100644
--- a/packages/sundials/src/Types.hs
+++ b/packages/sundials/src/Types.hs
@@ -9,31 +9,23 @@
9module Types where 9module Types where
10 10
11import Foreign.C.Types 11import Foreign.C.Types
12import Foreign.Ptr (Ptr)
13
14import Foreign.Storable (Storable(..))
15 12
16import qualified Language.Haskell.TH as TH 13import qualified Language.Haskell.TH as TH
17import qualified Language.C.Types as CT 14import qualified Language.C.Types as CT
18import qualified Data.Map as Map 15import qualified Data.Map as Map
19import Language.C.Inline.Context 16import Language.C.Inline.Context
20 17
21data BarType
22 18
23instance Storable BarType where 19data SunVector
24 sizeOf _ = sizeOf (undefined :: BarType)
25 alignment _ = alignment (undefined :: Ptr ())
26 peek _ = error "peek not implemented for BarType"
27 poke _ _ = error "poke not implemented for BarType"
28 20
29-- This is a lie!!! 21-- FIXME: Is this true?
30type SunIndexType = CLong 22type SunIndexType = CLong
31 23
32sunTypesTable :: Map.Map CT.TypeSpecifier TH.TypeQ 24sunTypesTable :: Map.Map CT.TypeSpecifier TH.TypeQ
33sunTypesTable = Map.fromList 25sunTypesTable = Map.fromList
34 [ 26 [
35 (CT.TypeName "sunindextype", [t| SunIndexType |] ) 27 (CT.TypeName "sunindextype", [t| SunIndexType |] )
36 , (CT.TypeName "BarType", [t| BarType |] ) 28 , (CT.TypeName "SunVector", [t| SunVector |] )
37 ] 29 ]
38 30
39sunCtx :: Context 31sunCtx :: Context