cfhammill / lenses

Elegant Data Manipulation with Lenses
https://cfhammill.github.io/lenses
Other
27 stars 4 forks source link

Add a standard subsetting promoter #25

Open cfhammill opened 6 years ago

cfhammill commented 6 years ago

Promote a standard accessor strings, probably limited to $, [, [[, @, to a lens e.g

promote_l( ~ .[[1]]$col[[2]]@slt[1:5] ) 

equal to

index(1) %.% 
  index("col") %.% 
  index(2) %.% 
  slot_l("slt") %.% 
  indices(1:5)
cfhammill commented 6 years ago

alternatively, write pluck_l semi emulating purrr::pluck as a lens

cfhammill commented 6 years ago

or both...