summoner
summoner copied to clipboard
Add optional 'version' field to the 'prelude`
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
- Should we do any validation, like, check that all components are only numbers?
- What to do with
stack
? Always add toextra-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"
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 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.