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
Packages
Cabal
Commits
ce4d7eb6
Commit
ce4d7eb6
authored
Sep 17, 2008
by
Duncan Coutts
Browse files
Allow addKnownProgram to be used as an update, not just insert
ie preserves any existing user-supplied path and args
parent
6f5155cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Distribution/Simple/Program.hs
View file @
ce4d7eb6
...
...
@@ -286,7 +286,8 @@ restoreProgramConfiguration = addKnownPrograms
-- | Add a known program that we may configure later
addKnownProgram
::
Program
->
ProgramConfiguration
->
ProgramConfiguration
addKnownProgram
prog
=
updateUnconfiguredProgs
$
Map
.
insert
(
programName
prog
)
(
prog
,
Nothing
,
[]
)
Map
.
insertWith
combine
(
programName
prog
)
(
prog
,
Nothing
,
[]
)
where
combine
_
(
_
,
path
,
args
)
=
(
prog
,
path
,
args
)
addKnownPrograms
::
[
Program
]
->
ProgramConfiguration
->
ProgramConfiguration
addKnownPrograms
progs
conf
=
foldl'
(
flip
addKnownProgram
)
conf
progs
...
...
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