Open ianmackenzie opened 4 months ago
I'd personally love to have equalWithin
and interpolateFrom
Yes, that sounds like a great proposal. I think the main reason I didn't just do it was mostly licensing related as I wasn't confident the licenses were compatible. If @ianmackenzie you're happy to contribute this code under this project's license (assuming you're the original author), then that wouldn't be a problem.
I am indeed the original author! Should hopefully have some PRs incoming soon...
This new package looks great and I'd love to update our code at work to use it, but it currently conflicts with the
Float.Extra
module in my own ianmackenzie/elm-float-extra package. Any interest in a PR merging at least some of the functionality from my package into theFloat.Extra
module in this package, so that my package can be deprecated? At a quick glance:equalWithin
seems like a useful more-explicit/more-customizable version ofaboutEqual
(might need to double-check that infinities and NaNs are handled the same way, but it looks to me like they are)interpolateFrom
is one I use quite a lot so I think would be a good additionrange
conflicts with the existingrange
function, but as mentioned in the docs for my version ofrange
you can replicate its functionality (with more flexibility) usingFloat.Extra.interpolateFrom
with functions from my elm-1d-parameter package, so that one can probably be left out. (I do think generating ranges ofFloat
values based on a number of steps instead of a step size is generally a more robust and less error-prone way to do it, though.)