3 ms·
> Scala doesn't have anything like this where the query is compiled monadically before execution Nonsense, Scala is arguably leading the way in the statically
by virtualwhys 10y ago
> Scala doesn't have anything like this where the query is compiled monadically before execution
Nonsense, Scala is arguably leading the way in the statically typed composable query dsl department; see Slick [1] and Quill [2] among others.
Outside of Haskell's Esqueleto I am not aware of any statically typed query dsl that comes remotely close to the aforementioned. LINQ to SQL/Objects provides static query generation but doesn't compose; beyond that, what is there?
[1] https://github.com/slick/slick https://github.com/slick/slick
[2] https://github.com/getquill/quill https://github.com/getquill/quill
- Arnavion 10y ago>LINQ to SQL/Objects provides static query generation but doesn't compose How do you mean? The result of a LINQ query is a sequence that can be used as the input of another LINQ query.
- virtualwhys 10y agoBy LINQ query I mean LINQ to SQL, not the basic LINQ collections functionality (the equivalent in Scala being for comprehensions, BTW). If you have an example of .NET based query composition to share I'd like to see it; last I checked there was no such functionality available.
- MichaelGG 10y agoLINQ to SQL ends up creating an expression on IQueryable. You can build this expression up any way you want, including in bits and pieces. You can tack on Wheres and Selects any time you like. It's more composable than pain text SQL since the parts can go in any order. It's only after you force it to materialize (I.e. call ToList) that you can't further "compose" it.
- deleted 10y ago[deleted]
- tome 10y ago* https://github.com/tomjaguarpaw/haskell-opaleye https://github.com/tomjaguarpaw/haskell-opaleye * https://github.com/khibino/haskell-relational-record https://github.com/khibino/haskell-relational-record