Hacker News new | ask | show | jobs
by r1b 503 days ago
Nodding along furiously. One area where this comes up is when you want to export some piece of logic that effectively “returns a table”.

For example, I work with a source of data that requires a particularly hairy JOIN strategy. The logic is the same for any table with the same “shape”, but no one can reuse it without copy / paste.

1 comments

See Esqueleto in Haskell, Slick and Quill in Scala, probably LINQ or some variant on .NET in C#/F#.

All support building up arbitrarily complex queries based on statically typed query fragments.

String fragment "composition" is like banging rocks together.