Top "Case-class" questions

Case classes are regular classes which export their constructor parameters and which provide a recursive decomposition mechanism via pattern matching.

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 …

scala functional-programming case-class
Case objects vs Enumerations in Scala

Are there any best-practice guidelines on when to use case classes (or case objects) vs extending Enumeration in Scala? They …

scala enumeration case-class
Scala case class inheritance

I have an application based on Squeryl. I define my models as case classes, mostly since I find convenient to …

scala inheritance case-class
Easy idiomatic way to define Ordering for a simple case class

I have a list of simple scala case class instances and I want to print them in predictable, lexicographical order …

scala sorting case-class
Overload constructor for Scala's Case Classes?

In Scala 2.8 is there a way to overload constructors of a case class? If yes, please put a snippet to …

scala constructor overloading scala-2.8 case-class
Scala: Parse JSON directly into a case class

Given a string of JSON, and a case class that corresponds to it, what's a simple way to parse the …

json scala parsing scala-2.10 case-class
Case class to map in Scala

Is there a nice way I can convert a Scala case class instance, e.g. case class MyClass(param1: String, …

scala case-class
How to override apply in a case class companion

So here's the situation. I want to define a case class like so: case class A(val s: String) and …

scala pattern-matching case-class
How to get around the Scala case class limit of 22 fields?

Scala case classes have a limit of 22 fields in the constructor. I want to exceed this limit, is there a …

scala case-class
hashCode in case classes in Scala

I've read that Scala'a case class construct automatically generates a fitting equals and hashCode implementation. What does exactly the generated …

scala hashcode case-class