elm-community / list-extra

Convenience functions for working with List.
http://package.elm-lang.org/packages/elm-community/list-extra/latest
MIT License
135 stars 58 forks source link

Example fix for #164 #165

Open jmbromley opened 2 years ago

jmbromley commented 2 years ago

This is an example of how #164 could be fixed, by adding strictly tail recursive versions of groupsOf and friends for when they are needed, while still allowing access to the (presumably faster) default versions. It simply uses a direct copy of the tail recursive version of List.take that is used internally by elm/core.

This is just a sample, and intended more to create a place to discuss #164 rather than a definitive solution... perhaps it is considered too much of a corner case to fix anyway?