Something like the Scala type system seems like the best way to keep track of that kind of structure information and make use of it (perhaps even transparently). I can easily believe the current wrappers aren&#x27;t there yet though. (Afraid I switched jobs six months ago and haven&#x27;t been using Breeze or Spark since, so I can&#x27;t justify working on it myself at the moment)