summaryrefslogtreecommitdiff
path: root/packages/sundials
diff options
context:
space:
mode:
authorDominic Steinitz <dominic@steinitz.org>2018-03-19 16:52:00 +0000
committerDominic Steinitz <dominic@steinitz.org>2018-03-19 16:52:00 +0000
commitfce6059d26b0cdaa211232b4812c614fc0076818 (patch)
treedfc998e80da710b77e71b741dc887393cb28a1cf /packages/sundials
parent71903cf575c31a15f9385659445c65fd85d22246 (diff)
Remove redundant imports
Diffstat (limited to 'packages/sundials')
-rw-r--r--packages/sundials/src/Main.hs19
-rw-r--r--packages/sundials/src/Types.hs18
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
9import Data.Monoid ((<>)) 11import Data.Monoid ((<>))
10import Foreign.C.Types 12import Foreign.C.Types
11import Foreign.Ptr (Ptr) 13import Foreign.Ptr (Ptr)
12import Foreign.Marshal.Array
13import qualified Data.Vector.Storable as V 14import qualified Data.Vector.Storable as V
14 15
15import Data.Coerce (coerce) 16import Data.Coerce (coerce)
16import Data.Monoid ((<>))
17import qualified Data.Vector.Storable as V
18import qualified Data.Vector.Storable.Mutable as VM 17import qualified Data.Vector.Storable.Mutable as VM
19import Foreign.C.Types
20import Foreign.ForeignPtr (newForeignPtr_) 18import Foreign.ForeignPtr (newForeignPtr_)
21import Foreign.Ptr (Ptr)
22import Foreign.Storable (Storable) 19import Foreign.Storable (Storable)
23import qualified Language.C.Inline as C
24import qualified Language.C.Inline.Unsafe as CU
25import System.IO.Unsafe (unsafePerformIO) 20import System.IO.Unsafe (unsafePerformIO)
26 21
27import qualified Language.Haskell.TH as TH 22import Foreign.Storable (peekByteOff)
28import qualified Language.C.Types as CT
29import qualified Data.Map as Map
30import Language.C.Inline.Context
31
32import Foreign.C.String
33import Foreign.Storable (peek, poke, peekByteOff, pokeByteOff)
34import Data.Int
35 23
36import qualified Types as T 24import 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
228main :: IO ()
240main = do 229main = 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
6module Types where 8module Types where
7 9
8import qualified Language.C.Inline as C
9import qualified Language.C.Inline.Unsafe as CU
10import Data.Monoid ((<>))
11import Foreign.C.Types 10import Foreign.C.Types
12import Foreign.Ptr (Ptr) 11import Foreign.Ptr (Ptr)
13import Foreign.Marshal.Array
14import qualified Data.Vector.Storable as V
15 12
16import Data.Coerce (coerce)
17import Data.Monoid ((<>))
18import qualified Data.Vector.Storable as V
19import qualified Data.Vector.Storable.Mutable as VM
20import Foreign.C.Types
21import Foreign.ForeignPtr (newForeignPtr_)
22import Foreign.Ptr (Ptr)
23import Foreign.Storable (Storable(..)) 13import Foreign.Storable (Storable(..))
24import qualified Language.C.Inline as C
25import qualified Language.C.Inline.Unsafe as CU
26import System.IO.Unsafe (unsafePerformIO)
27 14
28import qualified Language.Haskell.TH as TH 15import qualified Language.Haskell.TH as TH
29import qualified Language.C.Types as CT 16import 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
38sunCtx :: Context
51sunCtx = mempty {ctxTypesTable = sunTypesTable} 39sunCtx = mempty {ctxTypesTable = sunTypesTable}
52 40