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 optional 'version' field to the 'prelude` #411

Open
chshersh opened this issue Feb 21, 2020 · 2 comments
Open

Add optional 'version' field to the 'prelude` #411

chshersh opened this issue Feb 21, 2020 · 2 comments
Labels
config TOML configurations generated project Files, folder generation by the summoner

Comments

@chshersh
Copy link
Contributor

chshersh commented Feb 21, 2020

So it will look like this:

[prelude]
    package = "relude"
    module  = "Relude"
    version = "0.6.0.0"

And in the .cabal file you'll have relude ^>= 0.6.0.0

Open questions

  1. Should we do any validation, like, check that all components are only numbers?
  2. What to do with stack? Always add to extra-deps or just ignore it?

Alternatives

Allow arbitrary text in the version, so users can write something like:

version = "^>= 0.6.0.0"

or

version = ">= 0.5.0 && < 0.7"
@chshersh chshersh added generated project Files, folder generation by the summoner config TOML configurations labels Feb 21, 2020
@willbasky
Copy link
Collaborator

Should we do any validation, like, check that all components are only numbers?

Validation is needed for all correct version strings, i guess.

What to do with stack? Always add to extra-deps or just ignore it?
Do you consider "stack without cabal" case?

@chshersh
Copy link
Contributor Author

@willbasky If we go with the flexible approach, then we can't implement validation at all. But if we decide to constrain version to a single version then we can add validation logic, we already wrote validation of PVP versions in policeman.

Do you consider "stack without cabal" case?

It's both. Either Stack-only or Cabal+Stack. When stack is enabled, all Stack-related files (like stack.yaml) are added. But custom preludes might not be in the chosen Stackage snaphshot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config TOML configurations generated project Files, folder generation by the summoner
Projects
None yet
Development

No branches or pull requests

2 participants