Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
1fa4aa51
Commit
1fa4aa51
authored
Dec 30, 2014
by
Andrey Mokhov
Browse files
Add replaceChar helper function.
parent
3bbb9fba
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Base.hs
View file @
1fa4aa51
...
...
@@ -10,6 +10,7 @@ module Base (
Args
,
arg
,
joinArgs
,
joinArgsWithSpaces
,
filterOut
,
replaceChar
)
where
import
Development.Shake
hiding
((
*>
))
...
...
@@ -42,3 +43,8 @@ joinArgs = intercalateArgs ""
filterOut
::
Args
->
[
String
]
->
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
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment