diff options
author | Dominic Steinitz <dominic@steinitz.org> | 2018-03-19 16:52:00 +0000 |
---|---|---|
committer | Dominic Steinitz <dominic@steinitz.org> | 2018-03-19 16:52:00 +0000 |
commit | fce6059d26b0cdaa211232b4812c614fc0076818 (patch) | |
tree | dfc998e80da710b77e71b741dc887393cb28a1cf /packages/sundials | |
parent | 71903cf575c31a15f9385659445c65fd85d22246 (diff) |
Remove redundant imports
Diffstat (limited to 'packages/sundials')
-rw-r--r-- | packages/sundials/src/Main.hs | 19 | ||||
-rw-r--r-- | packages/sundials/src/Types.hs | 18 |
2 files changed, 7 insertions, 30 deletions
diff --git a/packages/sundials/src/Main.hs b/packages/sundials/src/Main.hs index ab5b153..b3ebcb3 100644 --- a/packages/sundials/src/Main.hs +++ b/packages/sundials/src/Main.hs | |||
@@ -1,3 +1,5 @@ | |||
1 | {-# OPTIONS_GHC -Wall #-} | ||
2 | |||
1 | {-# LANGUAGE QuasiQuotes #-} | 3 | {-# LANGUAGE QuasiQuotes #-} |
2 | {-# LANGUAGE TemplateHaskell #-} | 4 | {-# LANGUAGE TemplateHaskell #-} |
3 | {-# LANGUAGE MultiWayIf #-} | 5 | {-# LANGUAGE MultiWayIf #-} |
@@ -9,29 +11,15 @@ import qualified Language.C.Inline.Unsafe as CU | |||
9 | import Data.Monoid ((<>)) | 11 | import Data.Monoid ((<>)) |
10 | import Foreign.C.Types | 12 | import Foreign.C.Types |
11 | import Foreign.Ptr (Ptr) | 13 | import Foreign.Ptr (Ptr) |
12 | import Foreign.Marshal.Array | ||
13 | import qualified Data.Vector.Storable as V | 14 | import qualified Data.Vector.Storable as V |
14 | 15 | ||
15 | import Data.Coerce (coerce) | 16 | import Data.Coerce (coerce) |
16 | import Data.Monoid ((<>)) | ||
17 | import qualified Data.Vector.Storable as V | ||
18 | import qualified Data.Vector.Storable.Mutable as VM | 17 | import qualified Data.Vector.Storable.Mutable as VM |
19 | import Foreign.C.Types | ||
20 | import Foreign.ForeignPtr (newForeignPtr_) | 18 | import Foreign.ForeignPtr (newForeignPtr_) |
21 | import Foreign.Ptr (Ptr) | ||
22 | import Foreign.Storable (Storable) | 19 | import Foreign.Storable (Storable) |
23 | import qualified Language.C.Inline as C | ||
24 | import qualified Language.C.Inline.Unsafe as CU | ||
25 | import System.IO.Unsafe (unsafePerformIO) | 20 | import System.IO.Unsafe (unsafePerformIO) |
26 | 21 | ||
27 | import qualified Language.Haskell.TH as TH | 22 | import Foreign.Storable (peekByteOff) |
28 | import qualified Language.C.Types as CT | ||
29 | import qualified Data.Map as Map | ||
30 | import Language.C.Inline.Context | ||
31 | |||
32 | import Foreign.C.String | ||
33 | import Foreign.Storable (peek, poke, peekByteOff, pokeByteOff) | ||
34 | import Data.Int | ||
35 | 23 | ||
36 | import qualified Types as T | 24 | import qualified Types as T |
37 | 25 | ||
@@ -237,6 +225,7 @@ solveOdeC fun f0 = unsafePerformIO $ do | |||
237 | } |] | 225 | } |] |
238 | return res | 226 | return res |
239 | 227 | ||
228 | main :: IO () | ||
240 | main = do | 229 | main = do |
241 | let res = solveOdeC (coerce stiffish) (V.fromList [1.0]) | 230 | let res = solveOdeC (coerce stiffish) (V.fromList [1.0]) |
242 | putStrLn $ show res | 231 | putStrLn $ show res |
diff --git a/packages/sundials/src/Types.hs b/packages/sundials/src/Types.hs index 325072c..c42c34e 100644 --- a/packages/sundials/src/Types.hs +++ b/packages/sundials/src/Types.hs | |||
@@ -1,3 +1,5 @@ | |||
1 | {-# OPTIONS_GHC -Wall #-} | ||
2 | |||
1 | {-# LANGUAGE QuasiQuotes #-} | 3 | {-# LANGUAGE QuasiQuotes #-} |
2 | {-# LANGUAGE TemplateHaskell #-} | 4 | {-# LANGUAGE TemplateHaskell #-} |
3 | {-# LANGUAGE MultiWayIf #-} | 5 | {-# LANGUAGE MultiWayIf #-} |
@@ -5,25 +7,10 @@ | |||
5 | 7 | ||
6 | module Types where | 8 | module Types where |
7 | 9 | ||
8 | import qualified Language.C.Inline as C | ||
9 | import qualified Language.C.Inline.Unsafe as CU | ||
10 | import Data.Monoid ((<>)) | ||
11 | import Foreign.C.Types | 10 | import Foreign.C.Types |
12 | import Foreign.Ptr (Ptr) | 11 | import Foreign.Ptr (Ptr) |
13 | import Foreign.Marshal.Array | ||
14 | import qualified Data.Vector.Storable as V | ||
15 | 12 | ||
16 | import Data.Coerce (coerce) | ||
17 | import Data.Monoid ((<>)) | ||
18 | import qualified Data.Vector.Storable as V | ||
19 | import qualified Data.Vector.Storable.Mutable as VM | ||
20 | import Foreign.C.Types | ||
21 | import Foreign.ForeignPtr (newForeignPtr_) | ||
22 | import Foreign.Ptr (Ptr) | ||
23 | import Foreign.Storable (Storable(..)) | 13 | import Foreign.Storable (Storable(..)) |
24 | import qualified Language.C.Inline as C | ||
25 | import qualified Language.C.Inline.Unsafe as CU | ||
26 | import System.IO.Unsafe (unsafePerformIO) | ||
27 | 14 | ||
28 | import qualified Language.Haskell.TH as TH | 15 | import qualified Language.Haskell.TH as TH |
29 | import qualified Language.C.Types as CT | 16 | import qualified Language.C.Types as CT |
@@ -48,5 +35,6 @@ sunTypesTable = Map.fromList | |||
48 | , (CT.TypeName "BarType", [t| BarType |] ) | 35 | , (CT.TypeName "BarType", [t| BarType |] ) |
49 | ] | 36 | ] |
50 | 37 | ||
38 | sunCtx :: Context | ||
51 | sunCtx = mempty {ctxTypesTable = sunTypesTable} | 39 | sunCtx = mempty {ctxTypesTable = sunTypesTable} |
52 | 40 | ||