> Anyway, I think the way out of this mess is to have a functional, Haskell-like language for processing tables
I agree, and in a Haskell-like setting we can have any structured types (rather than just primitives).
That’s why I built hobbes: https://github.com/Morgan-Stanley/hobbes