In the following code,
trait SwingApi {
type ValueChanged <: Event
val ValueChanged: {
def unapply(x: Event): Option[TextField]
}
type ButtonClicked <: Event
val ButtonClicked: {
def unapply(x: Event): Option[Button]
}
type TextField <: {
def text: String
def subscribe(r: Reaction): Unit
def unsubscribe(r: Reaction): Unit
}
type Button <: {
def subscribe(r: Reaction): Unit
def unsubscribe(r: Reaction): Unit
}
}
Can someone please explain to me, what we mean by
val ValueChanged: {
def unapply(x: Event): Option[TextField]
}
and
val ButtonClicked: {
def unapply(x: Event): Option[Button]
}
What's the name for this pattern so that I can search for more details on Google.