Paket icon indicating copy to clipboard operation
Paket copied to clipboard

Leverage type system to restrict invalid version specification

Open shishkin opened this issue 12 years ago • 4 comments

Having a version specification syntax hidden in opaque strings is a shame given a powerful type system of F#. Having a strongly typed DSL in F# would make API more discoverable. Carefully chosen discriminated unions may provide better type safety than regular records with int fields. ~> 3.1 is not same as ~> 3.1.0.

Consider something like this: https://gist.github.com/shishkin/f4b4cb9d8a9d3959fccc.

A Nuget type provider would be even better. Thoughts?

shishkin avatar Sep 01 '14 14:09 shishkin

We probably need a set of version formats found in the wild to test against.

shishkin avatar Sep 01 '14 15:09 shishkin

I am not sure if anything not supporting the major.minor.patch scheme should be considered at all. There are a few schemes I know of that do not fit in, but they are far below what we can call a minority. I like the idea.

ilkerde avatar Sep 04 '14 20:09 ilkerde

@shishkin @forki After a few days, with a now somewhat clearer view on what Paket wants to achieve, as well as seeing the demands to Paket, I now changed my mind.

Yet it is quite unclear what other constraint models will pop up. We don't have (or expect) user interaction on Paket.lock. Plus, we are about to support different sources.

I think we should at least wait until above things are sorted out.

ilkerde avatar Sep 11 '14 18:09 ilkerde

closing this since we dropped FCS.

forki avatar Sep 20 '14 14:09 forki