summoner icon indicating copy to clipboard operation
summoner copied to clipboard

Add optional 'version' field to the 'prelude`

Open chshersh opened this issue 5 years ago • 2 comments

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 avatar Feb 21 '20 13:02 chshersh

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?

willbasky avatar Feb 24 '20 14:02 willbasky

@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.

chshersh avatar Feb 24 '20 14:02 chshersh