|
Scala example source code file (t0508.scala)
The Scala t0508.scala source codeobject Test extends App { case class Foo(s: String, n: Int) def foo[A, B, C](unapply1: A => Option[(B, C)], v: A) = { unapply1(v) match { case Some((fst, snd)) => println("first: " + fst, " second: " + snd) case _ => println(":(") } } foo(Foo.unapply, Foo("this might be fun", 10)) } Other Scala examples (source code examples)Here is a short list of links related to this Scala t0508.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.