Commit 212e91f1 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Replace isSlash with standard isPathSeparator.

parent 21bfb816
module Util (
module Data.Char,
isSlash,
replaceIf, replaceEq,
postProcessPackageData
) where
......@@ -8,9 +7,6 @@ module Util (
import Base
import Data.Char
isSlash :: Char -> Bool
isSlash = (`elem` ['/', '\\'])
replaceIf :: (a -> Bool) -> a -> [a] -> [a]
replaceIf p to = map (\from -> if p from then to else from)
......@@ -25,6 +21,6 @@ postProcessPackageData file = do
pkgData <- (filter ('$' `notElem`) . lines) <$> liftIO (readFile file)
length pkgData `seq` writeFileLines file $ map processLine pkgData
where
processLine line = replaceIf isSlash '_' prefix ++ suffix
processLine line = replaceIf isPathSeparator '_' prefix ++ suffix
where
(prefix, suffix) = break (== '=') line
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment