ndmitchell / extra

Extra Haskell functions
Other
93 stars 36 forks source link

Deprecate unnecessarily partial functions #51

Open josephcsible opened 4 years ago

josephcsible commented 4 years ago

We should deprecate replace and splitOn, and create alternatives for them that take a NonEmpty instead of crashing at runtime when their first parameter is empty.

ndmitchell commented 4 years ago

While it is would be nice if they were pure, syntactically writing a NonEmpty, especially for a String is cumbersome - often the first arg is a constant. Perhaps safe variants should go in the List.NonEmpty.Extra, then people can pick their poison.