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