You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 :
fill the gaps in purrr
Use these features on functions from other packages
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.
We would be less efficient but can't we create any
purrr::map*
function fromlapply
by using adverbs/tags/adverb factories for :map
etcmap_dbl
,map_chr
,modify
etcimap
etcl*
variants :lmap
etc*_at
/*_if
variants :map_if
,map_at
etc_depth
variants :map_depth
,modify_depth
map_if_else
(upcoming),map_case_when
(requested)map2
variants :map2
;map2_chr
etcpmap
variants :pmap
,pmap_chr
etcThe 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.
The text was updated successfully, but these errors were encountered: