Questions tagged [scala]

Scala is a general-purpose programming language principally targeting the Java Virtual Machine. Designed to express common programming patterns in a concise, elegant, and type-safe way, it fuses both imperative and functional programming styles. Its key features are: an advanced static type system with type inference; function types; pattern-matching; implicit parameters and conversions; operator overloading; full interoperability with Java; concurrency

Filter by
Sorted by
Tagged with
875votes
18answers
115kviews

Is the Scala 2.8 collections library a case of "the longest suicide note in history"? [closed]

I have just started to look at the Scala collections library re-implementation which is coming in the imminent 2.8 release. Those familiar with the library from 2.7 will notice that the library, from ...
711votes
13answers
222kviews

Difference between object and class in Scala

I'm just going over some Scala tutorials on the Internet and have noticed in some examples an object is declared at the start of the example. What is the difference between class and object in Scala?
user avatar
  • 20.3k
676votes
6answers
179kviews

Scala vs. Groovy vs. Clojure [closed]

Can someone please explain the major differences between Scala, Groovy and Clojure. I know each of these compiles to run on the JVM but I'd like a simple comparison between them.
user avatar
619votes
12answers
175kviews

What are the best use cases for Akka framework [closed]

I have heard lots of raving about Akka framework (Java/Scala service platform), but so far have not seen many actual examples of use cases it would be good for. So I would be interested in hearing ...
user avatar
  • 107k
594votes
7answers
162kviews

What are all the uses of an underscore in Scala?

I've taken a look at the list of surveys taken on scala-lang.org and noticed a curious question: "Can you name all the uses of “_”?". Can you? If yes, please do so here. Explanatory examples are ...
user avatar
  • 60.9k
475votes
17answers
138kviews

What is the difference between Scala's case class and class?

I searched in Google to find the differences between a case class and a class. Everyone mentions that when you want to do pattern matching on the class, use case class. Otherwise use classes and also ...
user avatar
451votes
1answer
14kviews

Scalaz iteratees: "Lifting" `EnumeratorT` to match `IterateeT` for a "bigger" monad

If I have an EnumeratorT and a corresponding IterateeT I can run them together: val en: EnumeratorT[String, Task] = EnumeratorT.enumList(List("a", "b", "c")) val it: IterateeT[String, Task, Int] = ...
user avatar
  • 17.3k
426votes
11answers
123kviews

What do all of Scala's symbolic operators mean?

Scala syntax has a lot of symbols. Since these kinds of names are difficult to find using search engines, a comprehensive list of them would be helpful. What are all of the symbols in Scala, and what ...
user avatar
  • 65.5k
423votes
2answers
51kviews

Where does Scala look for implicits?

An implicit question to newcomers to Scala seems to be: where does the compiler look for implicits? I mean implicit because the question never seems to get fully formed, as if there weren't words for ...
user avatar
408votes
11answers
71kviews

What is the difference between self-types and trait subclasses?

A self-type for a trait A: trait B trait A { this: B => } says that "A cannot be mixed into a concrete class that does not also extend B". On the other hand, the following: trait B trait A ...
user avatar
  • 7,379
394votes
8answers
102kviews

What is the advantage of using abstract classes instead of traits?

What is the advantage of using an abstract class instead of a trait (apart from performance)? It seems like abstract classes can be replaced by traits in most cases.
user avatar
  • 14.3k
387votes
11answers
80kviews

How do I get around type erasure on Scala? Or, why can't I get the type parameter of my collections?

It's a sad fact of life on Scala that if you instantiate a List[Int], you can verify that your instance is a List, and you can verify that any individual element of it is an Int, but not that it is a ...
user avatar
384votes
4answers
187kviews

Scala list concatenation, ::: vs ++

Is there any difference between ::: and ++ for concatenating lists in Scala? scala> List(1,2,3) ++ List(4,5) res0: List[Int] = List(1, 2, 3, 4, 5) scala> List(1,2,3) ::: List(4,5) res1: List[...
user avatar
  • 49.6k
380votes
1answer
75kviews

What is a TypeTag and how do I use it?

All I know about TypeTags is that they somehow replaced Manifests. Information on the Internet is scarce and doesn't provide me with a good sense of the subject. So I'd be happy if someone shared a ...
user avatar
  • 5,784
361votes
6answers
101kviews

What is a sealed trait?

Sealed classes are described in 'Programming in Scala', but sealed traits are not. Where can I find more information about a sealed trait? I would like to know, if a sealed trait is the same as a ...
user avatar

15 30 50 per page
1
2 3 4 5
7197