Is your feature request related to a problem? Please describe.
One might expect that when a mutable vector is passed to a quasiquote, that the R code in the quasiquote can modify the vector. But this is not the case. The vector is passed by value.
Describe the solution you'd like
Since these mutable vectors on the Haskell side are actually proxies for R vectors, R should be able to work with
them just like it works with native R vectors.
Describe alternatives you've considered
Of course, we could simply copy out the vector as a list using fromList, but the point is to reduce the amount of copying.
Additional context
This would probably require some redesign of the Haskell/R interface because the current interface evaluates the
R expresion in a quasiquote by placing it into an R function parametrized by the input Haskell variables/vectors, and
vector parameters are passed by value in R (so the called function cannot change the input vector, mutable or not).
After reading the online docs it seems this would violate the working assumption that hexp can be assumed to be pure. I would close this issue of I could, but it seems this is not possible.
Is your feature request related to a problem? Please describe. One might expect that when a mutable vector is passed to a quasiquote, that the R code in the quasiquote can modify the vector. But this is not the case. The vector is passed by value.
Describe the solution you'd like Since these mutable vectors on the Haskell side are actually proxies for R vectors, R should be able to work with them just like it works with native R vectors.
Describe alternatives you've considered Of course, we could simply copy out the vector as a list using fromList, but the point is to reduce the amount of copying.
Additional context This would probably require some redesign of the Haskell/R interface because the current interface evaluates the R expresion in a quasiquote by placing it into an R function parametrized by the input Haskell variables/vectors, and vector parameters are passed by value in R (so the called function cannot change the input vector, mutable or not).