// A pair of arbitrary case classes case class Foo(i : Int, s : String) case class Bar(b : Boolean, s : String, d : Double)
This method has been deprecated in favor of macro assertion and will be removed in a future version of ScalaTest. If you need this, please copy the source code into your own trait instead.
This method has been deprecated in favor of macro assertion and will be removed in a future version of ScalaTest. If you need this, please copy the source code into your own trait instead.
This method has been deprecated in favor of macro assumption and will be removed in a future version of ScalaTest. If you need this, please copy the source code into your own trait instead.
This method has been deprecated in favor of macro assumption and will be removed in a future version of ScalaTest. If you need this, please copy the source code into your own trait instead.
Please use 'an [Exception] should be thrownBy { ... }' syntax instead
This expect method has been deprecated. Please replace all invocations of expect with an identical invocation of assertResult instead.
This expect method has been deprecated. Please replace all invocations of expect with an identical invocation of assertResult instead.
This expectResult method has been deprecated. Please replace all invocations of expectResult with an identical invocation of assertResult instead.
This expectResult method has been deprecated. Please replace all invocations of expectResult with an identical invocation of assertResult instead.
Automatic type class instance derivation
Based on and extending
Generic
andLabelledGeneric
, Lars Hupel (@larsr_h) has contributed theTypeClass
family of type classes, which provide automatic type class derivation facilities roughly equivalent to those available with GHC as described in "A Generic Deriving Mechanism for Haskell". There is a description of an earlier iteration of the Scala mechanism here, and examples of its use derivingShow
andMonoid
instances here and here for labelled coproducts and unlabelled products respectively.For example, in the
Monoid
case, once the general deriving infrastructure for monoids is in place, instances are automatically available for arbitrary case classes without any additional boilerplateThe shapeless-contrib project also contains automatically derived type class instances for Scalaz, Spire and Scalacheck.