elm-debug-controls icon indicating copy to clipboard operation
elm-debug-controls copied to clipboard

Make Debug.Control.choice take a nonempty list

Open MartinSStewart opened this issue 3 years ago • 1 comments

In the documentation for Debug.Control.choice it says

This will crash if you provide an empty list.

Why not change the type signature to ( String, Control a ) -> List ( String, Control a ) -> Control a so that can never happen?

MartinSStewart avatar Aug 02 '20 16:08 MartinSStewart

Yeah, I think that's a good change. It wasn't done originally because when I ported this to Elm 0.19, it wasn't yet clear what the community preference would be w/r to this sort of API, but I think your proposed type makes sense now.

avh4 avatar Aug 02 '20 17:08 avh4