Closed drathier closed 3 years ago
If we want to go with this. Presumably we then have to decide between:
fn : a -> List a -> ...
fn : (a, List a) -> ...
type alias NonEmpty a = (a, List a)
type NonEmpty a = NonEmpty a (List a)
mgold/elm-nonempty-list
Just noting that elm/random
went with a -> List a -> ...
https://package.elm-lang.org/packages/elm/random/latest/Random#uniform
I think I'd vote against this. It's not going to be safe with this change, but the api will be a bit less composible.
Do we want to change the api to use non-empty lists (probably via having function signatures like
fn : a -> List a -> ...
rather thanfn : List a -> ...
) to avoid some crashes at runtime?Main pros:
Main cons: