Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type signature and documentation to toSavedConfig #10413

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cabal-install/src/Distribution/Client/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ import qualified Distribution.Deprecated.ParseUtils as ParseUtils
import Distribution.Parsec (ParsecParser, parsecFilePath, parsecOptCommaList, parsecToken)
import Distribution.Simple.Command
( CommandUI (commandOptions)
, OptionField
, ShowOrParseArgs (..)
, commandDefaultFlags
)
Expand Down Expand Up @@ -1314,6 +1315,19 @@ configFieldDescriptions src =
ParseArgs
]
where
toSavedConfig
:: (FieldDescr a -> FieldDescr SavedConfig)
-- Lifting function.
9999years marked this conversation as resolved.
Show resolved Hide resolved
-> [OptionField a]
-- Option fields.
-> [String]
-- Fields to exclude, by name.
-> [FieldDescr a]
-- Field replacements.
--
-- If an option is found with the same name as one of these replacement
-- fields, the replacement field is used instead of the option.
-> [FieldDescr SavedConfig]
toSavedConfig lift options exclusions replacements =
[ lift (fromMaybe field replacement)
| opt <- options
Expand Down
Loading