Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
Cabal
Commits
dc420376
Commit
dc420376
authored
9 years ago
by
Duncan Coutts
Browse files
Options
Downloads
Patches
Plain Diff
Clarify comments about the ProgramDb Read/Show/Binary instances
parent
4164e015
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Cabal/Distribution/Simple/Program/Db.hs
+14
-7
14 additions, 7 deletions
Cabal/Distribution/Simple/Program/Db.hs
with
14 additions
and
7 deletions
Cabal/Distribution/Simple/Program/Db.hs
+
14
−
7
View file @
dc420376
...
...
@@ -124,17 +124,24 @@ updateConfiguredProgs update conf =
-- Read & Show instances are based on listToFM
-- Note that we only serialise the configured part of the database, this is
-- because we don't need the unconfigured part after the configure stage, and
-- additionally because we cannot read/show 'Program' as it contains functions.
-- | Note that this instance does not preserve the known 'Program's.
-- See 'restoreProgramDb' for details.
--
instance
Show
ProgramDb
where
show
=
show
.
Map
.
toAscList
.
configuredProgs
-- | Note that this instance does not preserve the known 'Program's.
-- See 'restoreProgramDb' for details.
--
instance
Read
ProgramDb
where
readsPrec
p
s
=
[
(
emptyProgramDb
{
configuredProgs
=
Map
.
fromList
s'
},
r
)
|
(
s'
,
r
)
<-
readsPrec
p
s
]
-- | Note that this instance does not preserve the known 'Program's.
-- See 'restoreProgramDb' for details.
--
instance
Binary
ProgramDb
where
put
db
=
do
put
(
progSearchPath
db
)
...
...
@@ -149,10 +156,10 @@ instance Binary ProgramDb where
}
-- | The Read\/Show instance do
es
not preserve all the
unconfigured 'Programs'
-- because 'Program' is not in Read\/Show because
it contains functions. So to
-- fully restore a deserialised 'ProgramDb' use
this function to add
-- back all the known 'Program's.
-- | The
'
Read
'
\/
'
Show
' and 'Binary'
instance
s
do not preserve all the
--
unconfigured 'Programs'
because 'Program' is not in
'
Read
'
\/
'
Show
'
because
--
it contains functions. So to
fully restore a deserialised 'ProgramDb' use
--
this function to add
back all the known 'Program's.
--
-- * It does not add the default programs, but you probably want them, use
-- 'builtinPrograms' in addition to any extra you might need.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment