- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
+: is strange
Isn't this strange?
Array(1, 2) +: "hello"
=> scala.collection.immutable.IndexedSeq[Any] = Vector(Array(1, 2), h,
e, l, l, o)
Array(1, 2).+:("hello")
=> Array[Any] = Array(hello, 1, 2)
"hello" +: Array(1, 2)
=> Array[Any] = Array(hello, 1, 2)
"hello".+:(Array(1, 2))
=> scala.collection.immutable.IndexedSeq[Any] = Vector(Array(1, 2), h,
e, l, l, o)










Re: Re: +: is strange
implicit def throwable2Either[T >: Throwable](t: T) = new { def <->[V](v: V): T Either V = { Option(t).map(Left(_)).getOrElse(Right(v)) }}
var t = new Exceptiont <-> null
t = nullt <-> 3
On Tue, Jun 21, 2011 at 11:07 AM, Tony Morris <tonymorris [at] gmail [dot] com> wrote:
--
Lucas B. Torri