use intercalate instead of MissingH's join
authorJoey Hess <joeyh@joeyh.name>
Tue, 17 Nov 2015 21:27:24 +0000 (17:27 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 17 Nov 2015 21:27:24 +0000 (17:27 -0400)
The two functions are identical.

Utility/FileSystemEncoding.hs
Utility/FreeDesktop.hs
Utility/Path.hs
Utility/SafeCommand.hs

index 2d9691d522f8c8d968f73a100afb70ac492e34a6..67341d371d283a298f155f740fd57f400b537ff7 100644 (file)
@@ -29,6 +29,7 @@ import System.IO.Unsafe
 import qualified Data.Hash.MD5 as MD5
 import Data.Word
 import Data.Bits.Utils
+import Data.List
 import Data.List.Utils
 import qualified Data.ByteString.Lazy as L
 #ifdef mingw32_HOST_OS
@@ -125,12 +126,12 @@ decodeW8 = s2w8 . _encodeFilePath
 
 {- Like encodeW8 and decodeW8, but NULs are passed through unchanged. -}
 encodeW8NUL :: [Word8] -> FilePath
-encodeW8NUL = join nul . map encodeW8 . split (s2w8 nul)
+encodeW8NUL = intercalate nul . map encodeW8 . split (s2w8 nul)
   where
        nul = ['\NUL']
 
 decodeW8NUL :: FilePath -> [Word8]
-decodeW8NUL = join (s2w8 nul) . map decodeW8 . split nul
+decodeW8NUL = intercalate (s2w8 nul) . map decodeW8 . split nul
   where
        nul = ['\NUL']
 
index 70332490bf3a9dce1f1915cdcde4361d529e6364..f8b9fd70978d0731f9b112552394aea33e090192 100644 (file)
@@ -59,7 +59,7 @@ toString (ListV l)
        | null l = ""
        | otherwise = (intercalate ";" $ map (escapesemi . toString) l) ++ ";"
   where
-       escapesemi = join "\\;" . split ";"
+       escapesemi = intercalate "\\;" . split ";"
 
 genDesktopEntry :: String -> String -> Bool -> FilePath -> Maybe String -> [String] -> DesktopEntry
 genDesktopEntry name comment terminal program icon categories = catMaybes
index 4c2dd5c8bf7cd74bec05749b40645a5b4e0f84d2..1771d1e6d64b130e796165412a086cc0b32d3686 100644 (file)
@@ -89,7 +89,7 @@ parentDir = takeDirectory . dropTrailingPathSeparator
 upFrom :: FilePath -> Maybe FilePath
 upFrom dir
        | length dirs < 2 = Nothing
-       | otherwise = Just $ joinDrive drive (join s $ init dirs)
+       | otherwise = Just $ joinDrive drive (intercalate s $ init dirs)
   where
        -- on Unix, the drive will be "/" when the dir is absolute, otherwise ""
        (drive, path) = splitDrive dir
@@ -149,7 +149,7 @@ relPathDirToFile from to = relPathDirToFileAbs <$> absPath from <*> absPath to
 relPathDirToFileAbs :: FilePath -> FilePath -> FilePath
 relPathDirToFileAbs from to
        | takeDrive from /= takeDrive to = to
-       | otherwise = join s $ dotdots ++ uncommon
+       | otherwise = intercalate s $ dotdots ++ uncommon
   where
        s = [pathSeparator]
        pfrom = split s from
index 40d41c7a22666c2640a27d71d94800cdad5c3fe4..5ce17a8453b139538d1f2e2902af00cc0da1c3ba 100644 (file)
@@ -14,6 +14,7 @@ import Utility.Process
 import Data.String.Utils
 import System.FilePath
 import Data.Char
+import Data.List
 import Control.Applicative
 import Prelude
 
@@ -85,7 +86,7 @@ shellEscape :: String -> String
 shellEscape f = "'" ++ escaped ++ "'"
   where
        -- replace ' with '"'"'
-       escaped = join "'\"'\"'" $ split "'" f
+       escaped = intercalate "'\"'\"'" $ split "'" f
 
 -- | Unescapes a set of shellEscaped words or filenames.
 shellUnEscape :: String -> [String]