From b60cffc90daa55c82d0190965d51588aa7d1edce Mon Sep 17 00:00:00 2001 From: Adam Vogt Date: Thu, 30 Jan 2014 01:47:39 -0500 Subject: 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 --- Config.hs | 11 +++++------ lib/Data/Packed/Internal/Matrix.hs | 2 +- lib/Data/Packed/Internal/Vector.hs | 2 +- lib/Numeric/LinearAlgebra/Util.hs | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Config.hs b/Config.hs index a81676f..5145d1a 100644 --- a/Config.hs +++ b/Config.hs @@ -48,20 +48,20 @@ writeTestProg bInfo contents = writeFile (testProgLoc bInfo) contents -- compile, discarding error messages compile cmd = do - let processRecord = (shell $ join cmd) { std_out = CreatePipe + let processRecord = (shell $ unwords cmd) { std_out = CreatePipe , std_err = CreatePipe } ( _, _, _, h) <- createProcess processRecord waitForProcess h -- command to compile the test program compileCmd bInfo buildInfo = [ "gcc " - , (join $ ccOptions buildInfo) - , (join $ cppOptions buildInfo) - , (join $ map ("-I"++) $ includeDirs buildInfo) + , (unwords $ ccOptions buildInfo) + , (unwords $ cppOptions buildInfo) + , (unwords $ map ("-I"++) $ includeDirs buildInfo) , testProgLoc bInfo , "-o" , testOutLoc bInfo - , (join $ map ("-L"++) $ extraLibDirs buildInfo) + , (unwords $ map ("-L"++) $ extraLibDirs buildInfo) ] -- compile a simple program with symbols from GSL and LAPACK with the given libs @@ -72,7 +72,6 @@ testprog bInfo buildInfo libs fmks = do ++ [ (prepend "-l" $ libs) , (prepend "-framework " fmks) ] -join = intercalate " " prepend x = unwords . map (x++) . words 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 fromRows :: Element t => [Vector t] -> Matrix t fromRows vs = case compatdim (map dim vs) of Nothing -> error "fromRows applied to [] or to vectors with different sizes" - Just c -> reshape c . join . map (adapt c) $ vs + Just c -> reshape c . Data.Packed.Internal.Vector.join . map (adapt c) $ vs where adapt c v | dim v == c = v | 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 @@ module Data.Packed.Internal.Vector ( Vector, dim, fromList, toList, (|>), - join, (@>), safe, at, at', subVector, takesV, + Data.Packed.Internal.Vector.join, (@>), safe, at, at', subVector, takesV, mapVector, mapVectorWithIndex, zipVectorWith, unzipVectorWith, mapVectorM, mapVectorM_, mapVectorWithIndexM, mapVectorWithIndexM_, 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) -- | concatenation of real vectors infixl 3 & (&) :: Vector Double -> Vector Double -> Vector Double -a & b = join [a,b] +a & b = Numeric.Container.join [a,b] -- | horizontal concatenation of real matrices infixl 3 ! @@ -206,7 +206,7 @@ vec = flatten . trans vech :: Element t => Matrix t -> Vector t -- ^ half-vectorization (of the lower triangular part) -vech m = join . zipWith f [0..] . toColumns $ m +vech m = Numeric.Container.join . zipWith f [0..] . toColumns $ m where f k v = subVector k (dim v - k) v -- cgit v1.2.3