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
60843423
Commit
60843423
authored
Jan 02, 2015
by
Andrey Mokhov
Browse files
Add args -- a variadic version of arg.
parent
1495a2d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Base.hs
View file @
60843423
...
...
@@ -7,7 +7,7 @@ module Base (
module
Data
.
Monoid
,
module
Data
.
List
,
Stage
(
..
),
Args
,
arg
,
Args
,
arg
,
args
,
ShowAction
(
..
),
Condition
(
..
),
joinArgs
,
joinArgsWithSpaces
,
splitArgs
,
filterOut
...
...
@@ -33,11 +33,25 @@ class ShowAction a where
showAction
::
a
->
Action
String
instance
ShowAction
String
where
showAction
=
return
showAction
=
return
arg
::
ShowAction
a
=>
[
a
]
->
Args
arg
=
mapM
showAction
class
Collect
a
where
collect
::
Args
->
a
instance
Collect
Args
where
collect
=
id
instance
(
ShowAction
a
,
Collect
r
)
=>
Collect
(
a
->
r
)
where
collect
prev
next
=
collect
$
do
next'
<-
showAction
next
prev
<>
return
[
next'
]
args
::
Collect
a
=>
a
args
=
collect
mempty
intercalateArgs
::
String
->
Args
->
Args
intercalateArgs
s
args
=
do
as
<-
args
...
...
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