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
f2de618b
Commit
f2de618b
authored
May 25, 2011
by
Duncan Coutts
Browse files
Export the list of InstalledPackageInfo fields
To allow parsers & pretty-printers for extensions of the format.
parent
0a1b4810
Changes
1
Hide whitespace changes
Inline
Side-by-side
Distribution/InstalledPackageInfo.hs
View file @
f2de618b
...
...
@@ -61,6 +61,7 @@ module Distribution.InstalledPackageInfo (
parseInstalledPackageInfo
,
showInstalledPackageInfo
,
showInstalledPackageInfoField
,
fieldsInstalledPackageInfo
,
)
where
import
Distribution.ParseUtils
...
...
@@ -170,22 +171,23 @@ noVersion = Version{ versionBranch=[], versionTags=[] }
-- Parsing
parseInstalledPackageInfo
::
String
->
ParseResult
InstalledPackageInfo
parseInstalledPackageInfo
=
parseFieldsFlat
all_fields
emptyInstalledPackageInfo
parseInstalledPackageInfo
=
parseFieldsFlat
fieldsInstalledPackageInfo
emptyInstalledPackageInfo
-- -----------------------------------------------------------------------------
-- Pretty-printing
showInstalledPackageInfo
::
InstalledPackageInfo
->
String
showInstalledPackageInfo
=
showFields
all_
fields
showInstalledPackageInfo
=
showFields
fields
InstalledPackageInfo
showInstalledPackageInfoField
::
String
->
Maybe
(
InstalledPackageInfo
->
String
)
showInstalledPackageInfoField
=
showSingleNamedField
all_
fields
showInstalledPackageInfoField
=
showSingleNamedField
fields
InstalledPackageInfo
-- -----------------------------------------------------------------------------
-- Description of the fields, for parsing/printing
all_
fields
::
[
FieldDescr
InstalledPackageInfo
]
all_
fields
=
basicFieldDescrs
++
installedFieldDescrs
fields
InstalledPackageInfo
::
[
FieldDescr
InstalledPackageInfo
]
fields
InstalledPackageInfo
=
basicFieldDescrs
++
installedFieldDescrs
basicFieldDescrs
::
[
FieldDescr
InstalledPackageInfo
]
basicFieldDescrs
=
...
...
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