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
9bde7d86
Commit
9bde7d86
authored
Jul 14, 2015
by
Andrey Mokhov
Browse files
Clean up Base.
parent
772ea960
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Base.hs
View file @
9bde7d86
...
...
@@ -10,7 +10,6 @@ module Base (
Stage
(
..
),
Arg
,
ArgList
,
ShowArg
(
..
),
ShowArgs
(
..
),
filterOut
,
productArgs
,
concatArgs
)
where
...
...
@@ -56,21 +55,9 @@ class ShowArgs a where
instance
ShowArgs
[
String
]
where
showArgs
=
return
instance
ShowArgs
[
Arg
]
where
showArgs
=
sequence
instance
ShowArgs
[
ArgList
]
where
showArgs
=
mconcat
instance
ShowArgs
a
=>
ShowArgs
(
Action
a
)
where
showArgs
=
(
showArgs
=<<
)
-- Filter out given arg(s) from a collection
filterOut
::
ShowArgs
a
=>
ArgList
->
a
->
ArgList
filterOut
as
exclude
=
do
exclude'
<-
showArgs
exclude
filter
(`
notElem
`
exclude'
)
<$>
as
-- Generate a cross product collection of two argument collections
-- Example: productArgs ["-a", "-b"] "c" = args ["-a", "c", "-b", "c"]
productArgs
::
(
ShowArgs
a
,
ShowArgs
b
)
=>
a
->
b
->
ArgList
...
...
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