moodymudskipper / tags

A collection of tags built using the package tag
GNU General Public License v3.0
8 stars 0 forks source link

Can't we drastically reduce the amount of purrr variants, AND expand possibilities, by using adverbs ? #8

Closed moodymudskipper closed 5 years ago

moodymudskipper commented 5 years ago

We would be less efficient but can't we create any purrr::map* function from lapply by using adverbs/tags/adverb factories for :

The way purrr seems to work now is that variants are created for each of those, AND if a combination is deemed common enough it gets its own verb. Inevitably we sometimes want a combination that doesn't exist, but they can't all exist.

The goal is not to replace the existing variants, but by extracting these features into independant adverbs (tags, adverb factories...) we can :

Type stability adverbs are really simple to implement as it's just post processing.

We already implemented the lambda formula adverb as a simple preprocessing on function arguments using heuristics (but using adverb factories we could be more flexible and name the argument to preprocess).

Adverbs for other variants might be more complex and less easy to generalize to a wide range of input functions but it's worth taking a shot.

This family of adverbs might be a nice use case for dialects , we could throw in an adverb for progress bars, and quasi quotation too.

moodymudskipper commented 5 years ago

to the fridge for now, the most useful variants would be to build the functionalities of the i prefix and _at _if suffixes