elm / compiler

Compiler for Elm, a functional language for reliable webapps.
https://elm-lang.org/
BSD 3-Clause "New" or "Revised" License
7.51k stars 656 forks source link

non-breaking type changes should be minor/patch #2208

Open lue-bird opened 3 years ago

lue-bird commented 3 years ago

The sem-ver could be less strict when changing the type in a minor way. Suggestion: Mark the following cases as minor changes:

Going from Specific or constrainedTypeVariable to typeVariable

- ifJust : Maybe Int -> Bool
+ ifJust : Maybe a -> Bool
- nothing : Maybe Int
+ nothing : Maybe a
- empty : List number
+ empty : List a
- sum : List Int -> Int
+ sum : List number -> number
- origin : ( Int, Int )
+ origin : ( number, number )
- sort : List String -> List String
+ sort : List comparable -> comparable

In these two cases, the functions can still be used like in older versions (→ no breaking API change). This does allow for more ways to interact with the API, though → minor change.

An example of where I've come across this is with phantom types, like in typesafe-array. An example: Every first type argument of Arr will be a In min max. Neither min nor max will be used in the type, so we can simply write length.

- Arr (In min max) ...
+ Arr length ...
github-actions[bot] commented 3 years ago

Thanks for reporting this! To set expectations:

Finally, please be patient with the core team. They are trying their best with limited resources.