diff options
Diffstat (limited to 'packages/sundials/src/Numeric/Sundials/CLangToHaskellTypes.hs')
-rw-r--r-- | packages/sundials/src/Numeric/Sundials/CLangToHaskellTypes.hs | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/packages/sundials/src/Numeric/Sundials/CLangToHaskellTypes.hs b/packages/sundials/src/Numeric/Sundials/CLangToHaskellTypes.hs deleted file mode 100644 index 0908cbe..0000000 --- a/packages/sundials/src/Numeric/Sundials/CLangToHaskellTypes.hs +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | {-# LANGUAGE QuasiQuotes #-} | ||
2 | {-# LANGUAGE TemplateHaskell #-} | ||
3 | {-# LANGUAGE OverloadedStrings #-} | ||
4 | {-# LANGUAGE EmptyDataDecls #-} | ||
5 | |||
6 | module Numeric.Sundials.CLangToHaskellTypes where | ||
7 | |||
8 | import Foreign.C.Types | ||
9 | |||
10 | import qualified Language.Haskell.TH as TH | ||
11 | import qualified Language.C.Types as CT | ||
12 | import qualified Data.Map as Map | ||
13 | import Language.C.Inline.Context | ||
14 | |||
15 | import qualified Data.Vector.Storable as V | ||
16 | |||
17 | |||
18 | data SunVector | ||
19 | data SunMatrix = SunMatrix { rows :: CInt | ||
20 | , cols :: CInt | ||
21 | , vals :: V.Vector CDouble | ||
22 | } | ||
23 | |||
24 | -- | This is true only if configured/ built as 64 bits | ||
25 | type SunIndexType = CLong | ||
26 | |||
27 | sunTypesTable :: Map.Map CT.TypeSpecifier TH.TypeQ | ||
28 | sunTypesTable = Map.fromList | ||
29 | [ | ||
30 | (CT.TypeName "sunindextype", [t| SunIndexType |] ) | ||
31 | , (CT.TypeName "SunVector", [t| SunVector |] ) | ||
32 | , (CT.TypeName "SunMatrix", [t| SunMatrix |] ) | ||
33 | ] | ||
34 | |||
35 | sunCtx :: Context | ||
36 | sunCtx = mempty {ctxTypesTable = sunTypesTable} | ||
37 | |||