choose
is a function from Sets to Options with no type specific cases
choose
is a function from Sets to Options with no type specific cases
object choose extends (Set ~> Option) { def apply[T](s : Set[T]) = s.headOption }
They are nevertheless interoperable with ordinary monomorphic function values.
They are nevertheless interoperable with ordinary monomorphic function values.
choose
is convertible to an ordinary monomorphic function value and can be
mapped across an ordinary Scala List
Being polymorphic, they may be passed as arguments to functions or methods and then applied to values of different types within those functions
However, they are more general than natural transformations and are able to capture type-specific cases
which, as we'll see below, makes them ideal for generic programming,
size
is a function from Ints or Strings or pairs to a size
defined
by type specific cases
The parameterless execute method has been deprecated and will be removed in a future version of ScalaTest. Please invoke execute with empty parens instead: execute().
The trap method is no longer needed for demos in the REPL, which now abreviates stack traces, and will be removed in a future version of ScalaTest
Polymorphic function values
Ordinary Scala function values are monomorphic. shapeless, however, provides an encoding of polymorphic function values. It supports natural transformations, which are familiar from libraries like Scalaz