Commit 1fa4aa51 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Add replaceChar helper function.

parent 3bbb9fba
...@@ -10,6 +10,7 @@ module Base ( ...@@ -10,6 +10,7 @@ module Base (
Args, arg, Args, arg,
joinArgs, joinArgsWithSpaces, joinArgs, joinArgsWithSpaces,
filterOut, filterOut,
replaceChar
) where ) where
import Development.Shake hiding ((*>)) import Development.Shake hiding ((*>))
...@@ -42,3 +43,8 @@ joinArgs = intercalateArgs "" ...@@ -42,3 +43,8 @@ joinArgs = intercalateArgs ""
filterOut :: Args -> [String] -> Args filterOut :: Args -> [String] -> Args
filterOut args list = filter (`notElem` list) <$> args filterOut args list = filter (`notElem` list) <$> args
replaceChar :: Char -> Char -> String -> String
replaceChar from to = (go from) . if from == '/' then go '\\' else id
where
go from' = map (\c -> if c == from' then to else c)
Markdown is supported
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