lenses icon indicating copy to clipboard operation
lenses copied to clipboard

Reshaping/Retyping lenses

Open cfhammill opened this issue 5 years ago • 1 comments

In the now closed #9 we proposed adding type conversion lenses.

In general we could have type conversion lenses

  • [ ] df2list (with suitable arg checking on set)
  • [ ] list2df (with suitable arg checking on view)
  • [ ] vec2list (with suitable arg checking on set)
  • [ ] list2vec (with suitable arg checking on view)
  • [ ] vec2vec (perhaps using https://github.com/r-lib/vctrs)

we could also have reshaping lenses

  • [ ] flatten_l: turn a nested list into a flat one
  • [x] reshape_l: change the dimensions of an array subject to the condition that prod(dim(x)) is preserved.

cfhammill avatar Oct 04 '18 20:10 cfhammill