This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class some[X](val value : X) { type T = X } | |
abstract class someFactory[S <: some[_]](val P : (S#T) => boolean) | |
{ | |
def apply(t : S#T) : Option[S] = if(P(t)) Some(fetch(t)) else None | |
def unapply(s : S) : Option[S#T] = if(s == null) None else Some(s.value) | |
def fetch(t : S#T) = mk(t) |
NewerOlder