summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Internal/Common.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2009-11-13 11:00:34 +0000
committerAlberto Ruiz <aruiz@um.es>2009-11-13 11:00:34 +0000
commitd404bcf2859f6b4f94d34dec205895019ed564e8 (patch)
tree0866db6fd6220c741062d93daa75705d7a8204d3 /lib/Data/Packed/Internal/Common.hs
parente8939f7f7f9654bcf0ab9a0cd3720279117e2e29 (diff)
explicit export lists in internal modules
Diffstat (limited to 'lib/Data/Packed/Internal/Common.hs')
-rw-r--r--lib/Data/Packed/Internal/Common.hs58
1 files changed, 7 insertions, 51 deletions
diff --git a/lib/Data/Packed/Internal/Common.hs b/lib/Data/Packed/Internal/Common.hs
index 879dade..629016d 100644
--- a/lib/Data/Packed/Internal/Common.hs
+++ b/lib/Data/Packed/Internal/Common.hs
@@ -14,25 +14,20 @@
14----------------------------------------------------------------------------- 14-----------------------------------------------------------------------------
15-- #hide 15-- #hide
16 16
17module Data.Packed.Internal.Common where 17module Data.Packed.Internal.Common(
18 Adapt,
19 app1, app2, app3, app4,
20 (//), check,
21 partit, common,
22 fi
23) where
18 24
19import Foreign 25import Foreign
20import Complex
21import Control.Monad(when) 26import Control.Monad(when)
22import Debug.Trace
23import Foreign.C.String(peekCString) 27import Foreign.C.String(peekCString)
24import Foreign.C.Types 28import Foreign.C.Types
25import Foreign.Storable.Complex() 29import Foreign.Storable.Complex()
26 30
27
28-- | @debug x = trace (show x) x@
29debug :: (Show a) => a -> a
30debug x = trace (show x) x
31
32-- | useful for expressions like @sortBy (compare \`on\` length)@
33on :: (a -> a -> b) -> (t -> a) -> t -> t -> b
34on f g = \x y -> f (g x) (g y)
35
36-- | @partit 3 [1..9] == [[1,2,3],[4,5,6],[7,8,9]]@ 31-- | @partit 3 [1..9] == [[1,2,3],[4,5,6],[7,8,9]]@
37partit :: Int -> [a] -> [[a]] 32partit :: Int -> [a] -> [[a]]
38partit _ [] = [] 33partit _ [] = []
@@ -139,42 +134,3 @@ check msg f = do
139 134
140-- | description of GSL error codes 135-- | description of GSL error codes
141foreign import ccall "auxi.h gsl_strerror" gsl_strerror :: CInt -> IO (Ptr CChar) 136foreign import ccall "auxi.h gsl_strerror" gsl_strerror :: CInt -> IO (Ptr CChar)
142
143---------------------------------------------------
144---------- signatures of the C functions ---------
145--------------------------------------------------
146type PD = Ptr Double --
147type PC = Ptr (Complex Double) --
148type TV = CInt -> PD -> IO CInt --
149type TVV = CInt -> PD -> TV --
150type TVVV = CInt -> PD -> TVV --
151type TM = CInt -> CInt -> PD -> IO CInt --
152type TMM = CInt -> CInt -> PD -> TM --
153type TVMM = CInt -> PD -> TMM --
154type TMVMM = CInt -> CInt -> PD -> TVMM --
155type TMMM = CInt -> CInt -> PD -> TMM --
156type TVM = CInt -> PD -> TM --
157type TVVM = CInt -> PD -> TVM --
158type TMV = CInt -> CInt -> PD -> TV --
159type TMMV = CInt -> CInt -> PD -> TMV --
160type TMVM = CInt -> CInt -> PD -> TVM --
161type TMMVM = CInt -> CInt -> PD -> TMVM --
162type TCM = CInt -> CInt -> PC -> IO CInt --
163type TCVCM = CInt -> PC -> TCM --
164type TCMCVCM = CInt -> CInt -> PC -> TCVCM --
165type TMCMCVCM = CInt -> CInt -> PD -> TCMCVCM --
166type TCMCMCVCM = CInt -> CInt -> PC -> TCMCVCM --
167type TCMCM = CInt -> CInt -> PC -> TCM --
168type TVCM = CInt -> PD -> TCM --
169type TCMVCM = CInt -> CInt -> PC -> TVCM --
170type TCMCMVCM = CInt -> CInt -> PC -> TCMVCM --
171type TCMCMCM = CInt -> CInt -> PC -> TCMCM --
172type TCV = CInt -> PC -> IO CInt --
173type TCVCV = CInt -> PC -> TCV --
174type TCVCVCV = CInt -> PC -> TCVCV --
175type TCMCV = CInt -> CInt -> PC -> TCV --
176type TVCV = CInt -> PD -> TCV --
177type TCVM = CInt -> PC -> TM --
178type TMCVM = CInt -> CInt -> PD -> TCVM --
179type TMMCVM = CInt -> CInt -> PD -> TMCVM --
180--------------------------------------------------