It depends on what exactly you mean by "LINQ". LINQ is a lot of things.
The most obvious answer: just use the .NET Scala port. This gives you full native access to everything in .NET, which obviously includes LINQ.
Unfortunately, the .NET Scala port was reset a couple of years ago. Fortunately, it was raised again a couple of months ago, with official funding directly from Microsoft no less. You can count on the release sometime in the 2011/2012 timeframe.
In any case, what is LINQ?
Several features added to .NET, namely C # and VB.NET for LINQ. They are not technically part of LINQ, but they are necessary prerequisites: output type, anonymous (structural) types, lambda expressions, function types ( Func<T...> and Action<T...> ) and expression trees. They were all in Scala for a long time, most of them were there forever.
It is also not a direct part of LINQ, but in C # LINQ query expressions can be used to generate XML, to emulate VB.NET XML literals. Scala has XML literals such as VB.NET.
More specifically LINQ
- specification for a set of standard query operators
- a set of implementations for these statements (i.e.,
IQueryable , LINQ-to-XML, LINQ-to-SQL, LINQ-to-Objects) - built-in built-in syntax for understanding LINQ queries
- Monad
In Scala, like in any other functional language (and in fact also in almost any other object-oriented language), query operators are simply part of the standard APIs. In .NET they have slightly strange names, while in Scala they have the same standard names as in other languages: Select is map , Aggregate is reduce (or fold ), SelectMany - flatMap , Where - filter or withFilter , orderBy is sort or sortBy or sortWith , and there is zip , take and takeWhile , etc. Thus, this applies to both the specification and the implementation of LINQ-to-Objects. Scala XML libraries also implement collection APIs that take care of LINQ-to-XML.
SQL APIs are not built into Scala, but there are third-party APIs that implement collection APIs.
Scala also has specialized syntax for these APIs, but unlike Haskell, which tries to make them look like imperative C-blocks and C #, which try to make them look like SQL queries, Scala tries to make them look for . They are called for understandings and are equivalent to understanding C # queries and understanding Haskell monads. (They also replace C # foreach and generators ( yield return )).
But if you really want to find out if there are analogues for LINQ in Scala, you first need to specify what exactly you mean by "LINQ". (And, of course, if you want to know if they are "normal", you will also have to determine this.)