Compile types and pure functions between them (in an ML-like or Haskell-like language) in SQL

Sometimes we need to store a binary tree or forest or a set of data elements of another algebraic type. It can be done in some way. And it would be nice to perform some transformations of this data (for example, a binary rebalancing tree) also using SQL only .

I'm interested in a way to declare types and pure functions between them (in an ML-like or Haskell-like language) and compile them in SQL; Hope this allows me to reuse code for standard algorithms like hedge_union. He exists? Maybe this compiler is already implemented (although I can’t use it), or there is a library in Coq that can extract code in SQL or something else.

+3
source share
1 answer

See recent research on generating SQL from embedded functional languages ​​such as Ferry — mostly typed, language-integrated queries.

: Ferry - DSH - Haskell.

+2

All Articles