scala - Existential Quantification over Values -
I have come to existential quantities at the values in Scala language specificity (3.2.10 survival type).
Do anyone have clear usage cases for this? For some, T {val x: S}
is defined as something for {type t <: with singleton S}
. Specification of singletron feature (3.2.1 singleton type) is mentioned but I did not find it in Scaladoc. Where is it defined?
It is useful with internal names, for example define in graphs and node squares. The quantitative quantity present at the price is used to write the type of nodes of some unspecified graphs.
some node = g.Node for some {val g: Graph}
This can be useful if you want a method that is two Takes nodes as logic, which comes from the same graph.
Pre>
Note that 2.7 This method will not accept the definition because it thinks that some types of recurrence
then if you have
val g1 = new Graph Val G2 = New Graph
Then compile these
with some two nodes (g1.newnode, g1.newNode) with some Two nodes (g2.newnode, g2.newNode)
but this does not
some two nodes (g1.newnode, g2.newNode) with some With two Nodes (g2.newnode, g1.newNode)
For the singleton feature, it is not really defined in a specific way, that is, it does not have a class file for it anyhow, Like ANIRF and tap, it is defined with these other types in src / compiler / scala / tools / nsc / symtab / definition.scala
, but I suspect that to do this Very useful information is also a strange animal which is the ultimate feature of which That it can not mix when you define a property or class, it is really more of a marker that the compiler is described as a type that is unique from any other type. / P>
Comments
Post a Comment