Skip to content

cabal init should mostly (only?) use defaults instead of asking. #11492

@AndreasPK

Description

@AndreasPK

For my whole Cabal life I've been asked to select options I don't care about. Hundreds of times really if not into the thousands by now.

I've developed an adverse feeling about cabal init to the point where I wonder "Is it worth being interrogated like this? Should I maybe just copy an existing .cabal file and manually update every single field instead?"

Therefore I request humbly: cabal init should mostly go with defaults and ask less questions.

I think there are two kinds of things cabal init asks about:

  • Things cabal check should ask if not specified that can be there as a comment.
  • Things I will never care much about and if I do I will just edit the .cabal file.

To go through them:

  • Cabal specification? I never cared just give me the newest. If I care about backwards compatibility I will set it as old as I can manually.
  • Package version? 0.1.0.0 is fine. If I'm going to release it I will change it manually anyway.
  • License? I'm not a lawyer. People who don't care are probably just hitting enter. People who do probably use GPL* so maybe okay with a default.
  • Author Name? Should be in cabal check probably.
  • Email/Homepage? If the project is good enough to deserve one surely you can afford to manually enter it in the .cabal file.
  • Category? Just remind me when I do cabal check.
  • Synopsis? We have types for that. (Actualy: Remind me during cabal check)
  • Main module? Literate programming isn't due a resurgence for another 10 years. Just use Main.hs
  • source folder? If I care it won't be one of the suggestions anyway so just pick one for me.
  • Language? Maybe worth chosing, but default could be GHC2021 by now.

For any reasonably complex project I will be editing the .cabal file anyway. So I don't care that much about the actual choice cabal init makes. I just use it so I don't have to remind myself if it was ghc-options or options-ghc again.

I'm not sure what others feeling about this are. But today I had to do cabal init twice in a row and I finally got annoyed enough to try and enact change.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions