diff options
author | Adam Vogt <vogt.adam@gmail.com> | 2014-01-30 01:47:39 -0500 |
---|---|---|
committer | Adam Vogt <vogt.adam@gmail.com> | 2014-01-30 01:52:35 -0500 |
commit | b60cffc90daa55c82d0190965d51588aa7d1edce (patch) | |
tree | d1591264f97ff30dc2c39201a27986585f6d46a0 | |
parent | 4382cadadfb4b9312c49fa5fe51537f60a7e2f54 (diff) |
rename variables so Prelude.join will not cause problems
* background:
http://www.haskell.org/haskellwiki/Functor-Applicative-Monad_Proposal#Current_stage:_Prepare_GHC
* the change happens in ghc-7.10, and these changes fix warnings with 7.8
-rw-r--r-- | Config.hs | 11 | ||||
-rw-r--r-- | lib/Data/Packed/Internal/Matrix.hs | 2 | ||||
-rw-r--r-- | lib/Data/Packed/Internal/Vector.hs | 2 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/Util.hs | 4 |
4 files changed, 9 insertions, 10 deletions
@@ -48,20 +48,20 @@ writeTestProg bInfo contents = writeFile (testProgLoc bInfo) contents | |||
48 | 48 | ||
49 | -- compile, discarding error messages | 49 | -- compile, discarding error messages |
50 | compile cmd = do | 50 | compile cmd = do |
51 | let processRecord = (shell $ join cmd) { std_out = CreatePipe | 51 | let processRecord = (shell $ unwords cmd) { std_out = CreatePipe |
52 | , std_err = CreatePipe } | 52 | , std_err = CreatePipe } |
53 | ( _, _, _, h) <- createProcess processRecord | 53 | ( _, _, _, h) <- createProcess processRecord |
54 | waitForProcess h | 54 | waitForProcess h |
55 | 55 | ||
56 | -- command to compile the test program | 56 | -- command to compile the test program |
57 | compileCmd bInfo buildInfo = [ "gcc " | 57 | compileCmd bInfo buildInfo = [ "gcc " |
58 | , (join $ ccOptions buildInfo) | 58 | , (unwords $ ccOptions buildInfo) |
59 | , (join $ cppOptions buildInfo) | 59 | , (unwords $ cppOptions buildInfo) |
60 | , (join $ map ("-I"++) $ includeDirs buildInfo) | 60 | , (unwords $ map ("-I"++) $ includeDirs buildInfo) |
61 | , testProgLoc bInfo | 61 | , testProgLoc bInfo |
62 | , "-o" | 62 | , "-o" |
63 | , testOutLoc bInfo | 63 | , testOutLoc bInfo |
64 | , (join $ map ("-L"++) $ extraLibDirs buildInfo) | 64 | , (unwords $ map ("-L"++) $ extraLibDirs buildInfo) |
65 | ] | 65 | ] |
66 | 66 | ||
67 | -- compile a simple program with symbols from GSL and LAPACK with the given libs | 67 | -- compile a simple program with symbols from GSL and LAPACK with the given libs |
@@ -72,7 +72,6 @@ testprog bInfo buildInfo libs fmks = do | |||
72 | ++ [ (prepend "-l" $ libs) | 72 | ++ [ (prepend "-l" $ libs) |
73 | , (prepend "-framework " fmks) ] | 73 | , (prepend "-framework " fmks) ] |
74 | 74 | ||
75 | join = intercalate " " | ||
76 | prepend x = unwords . map (x++) . words | 75 | prepend x = unwords . map (x++) . words |
77 | 76 | ||
78 | check bInfo buildInfo libs fmks = (ExitSuccess ==) `fmap` testprog bInfo buildInfo libs fmks | 77 | check bInfo buildInfo libs fmks = (ExitSuccess ==) `fmap` testprog bInfo buildInfo libs fmks |
diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs index 255009c..7504b39 100644 --- a/lib/Data/Packed/Internal/Matrix.hs +++ b/lib/Data/Packed/Internal/Matrix.hs | |||
@@ -154,7 +154,7 @@ toLists m = splitEvery (cols m) . toList . flatten $ m | |||
154 | fromRows :: Element t => [Vector t] -> Matrix t | 154 | fromRows :: Element t => [Vector t] -> Matrix t |
155 | fromRows vs = case compatdim (map dim vs) of | 155 | fromRows vs = case compatdim (map dim vs) of |
156 | Nothing -> error "fromRows applied to [] or to vectors with different sizes" | 156 | Nothing -> error "fromRows applied to [] or to vectors with different sizes" |
157 | Just c -> reshape c . join . map (adapt c) $ vs | 157 | Just c -> reshape c . Data.Packed.Internal.Vector.join . map (adapt c) $ vs |
158 | where | 158 | where |
159 | adapt c v | dim v == c = v | 159 | adapt c v | dim v == c = v |
160 | | otherwise = constantD (v@>0) c | 160 | | otherwise = constantD (v@>0) c |
diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs index 85e7f4f..c99f4f0 100644 --- a/lib/Data/Packed/Internal/Vector.hs +++ b/lib/Data/Packed/Internal/Vector.hs | |||
@@ -16,7 +16,7 @@ | |||
16 | module Data.Packed.Internal.Vector ( | 16 | module Data.Packed.Internal.Vector ( |
17 | Vector, dim, | 17 | Vector, dim, |
18 | fromList, toList, (|>), | 18 | fromList, toList, (|>), |
19 | join, (@>), safe, at, at', subVector, takesV, | 19 | Data.Packed.Internal.Vector.join, (@>), safe, at, at', subVector, takesV, |
20 | mapVector, mapVectorWithIndex, zipVectorWith, unzipVectorWith, | 20 | mapVector, mapVectorWithIndex, zipVectorWith, unzipVectorWith, |
21 | mapVectorM, mapVectorM_, mapVectorWithIndexM, mapVectorWithIndexM_, | 21 | mapVectorM, mapVectorM_, mapVectorWithIndexM, mapVectorWithIndexM_, |
22 | foldVector, foldVectorG, foldLoop, foldVectorWithIndex, | 22 | foldVector, foldVectorG, foldLoop, foldVectorWithIndex, |
diff --git a/lib/Numeric/LinearAlgebra/Util.hs b/lib/Numeric/LinearAlgebra/Util.hs index 39566ab..532556e 100644 --- a/lib/Numeric/LinearAlgebra/Util.hs +++ b/lib/Numeric/LinearAlgebra/Util.hs | |||
@@ -97,7 +97,7 @@ ones r c = konst 1 (r,c) | |||
97 | -- | concatenation of real vectors | 97 | -- | concatenation of real vectors |
98 | infixl 3 & | 98 | infixl 3 & |
99 | (&) :: Vector Double -> Vector Double -> Vector Double | 99 | (&) :: Vector Double -> Vector Double -> Vector Double |
100 | a & b = join [a,b] | 100 | a & b = Numeric.Container.join [a,b] |
101 | 101 | ||
102 | -- | horizontal concatenation of real matrices | 102 | -- | horizontal concatenation of real matrices |
103 | infixl 3 ! | 103 | infixl 3 ! |
@@ -206,7 +206,7 @@ vec = flatten . trans | |||
206 | 206 | ||
207 | vech :: Element t => Matrix t -> Vector t | 207 | vech :: Element t => Matrix t -> Vector t |
208 | -- ^ half-vectorization (of the lower triangular part) | 208 | -- ^ half-vectorization (of the lower triangular part) |
209 | vech m = join . zipWith f [0..] . toColumns $ m | 209 | vech m = Numeric.Container.join . zipWith f [0..] . toColumns $ m |
210 | where | 210 | where |
211 | f k v = subVector k (dim v - k) v | 211 | f k v = subVector k (dim v - k) v |
212 | 212 | ||