takusen -> cabal - some thoughts again

Marc Weber marco-oweber at gmx.de
Tue Mar 11 04:43:47 EDT 2008


dcoutts has told me that there was a choice:
Duplicating the record (one for assembling options the way it's now (A)) and
one for usage (B). Seems like beeing duplication but.. many 
(fromFlag configVerbose) in all Setup.lhs files is duplication as well.

(A) now :
  definition
    ConfigureFlags = {
     ...; configVerbose :: Flag Verbosity
                           ^^^ <- difference (for the user writing Setup.hs)
  usage
    fromFlag . configVerbose $ flags

(B) the way it was (seen by the Setup.hs writer) and the other way:
  definition
    ConfigureFlagsGetOpt = {
     ...; configVerbose :: Flag Verbosity

    -- no longer any non configured values.. defaults must have been
        filled in there and you see can see it
    ReadConfigureFlags = {
     ...; configVerbose :: Verbosity
                           ^^^^ <- difference (for the user writing Setup.hs )
  usage:
    configVerbose $ flags

Because Cabal is a tool designed to make package writing more easy for
the mass maybe the right way to go in the future is a design beeing
closer to (B) ? Why? Because you can just open Setup.hs and jump to the
definition and you see what you have to see no longer wondering about
default values and how things are used internally within Cabal.
(I mean wether and when defaultConfigFlags is actually used so it's safe
to use .. you know this already from my privious post :)

I don't want to break things.. I only want tell you about my thoughts.

Sincerly
Marc Weber



More information about the cabal-devel mailing list