Alex Rivera | Logout

What is the forSome keyword in Scala for?

Asked 2012-02-25T14:43:33.157
75

I found the following code snippet:

List[T] forSome { type T }

The forSome looks like a method, but my friend told me it's a keyword.

I googled it, but found few documents about forSome. What does it mean, and where can I get some documents about it?

Edit
Report

1 Answer

3

I don't know Scala, but your question picked up my interest and started Googling.

I found that in Scala's changelog:

"It is now possible to define existential types using the new keyword forSome. An existential type has the form T forSome {Q} where Q is a sequence of value and/or type declarations. "

answered 2012-02-25T14:45:42.153

Your Answer