|
Scala example source code file (t0508x.scala)
The Scala t0508x.scala source codefinal object Test extends java.lang.Object with Application { class Foo(val s: String, val n: Int) extends java.lang.Object { }; def foo[A >: Nothing <: Any, B >: Nothing <: Any, C >: Nothing <: Any] (unapply1: (A) => Option[(B, C)], v: A): Unit = unapply1.apply(v) match { case Some((fst @ _, snd @ _)) => scala.Predef.println(scala.Tuple2.apply[java.lang.String, java.lang.String]("first: ".+(fst), " second: ".+(snd))) case _ => scala.Predef.println(":(") } Test.this.foo[Test.Foo, String, Int]({ ((eta$0$1: Test.Foo) => Test.this.Foo.unapply(eta$0$1)) }, Test.this.Foo.apply("this might be fun", 10)); final object Foo extends java.lang.Object with ((String, Int) => Test.Foo) { def unapply(x$0: Test.Foo): Some[(String, Int)] = scala.Some.apply[(String, Int)](scala.Tuple2.apply[String, Int](x$0.s, x$0.n)); def apply(s: String, n: Int): Test.Foo = new Test.this.Foo(s, n) } } Other Scala examples (source code examples)Here is a short list of links related to this Scala t0508x.scala source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.