You are reading the wrong map function def map B (f: ((A, B)) ⇒ B) : MapB But you are using: def map B, That (f: ((A, B)) ⇒ B)(implicit bf: CanBuildFromMapA, B, B, That) : That Since you are returning a String you are not using the fist but the second. And for it the ScalaDoc says: a new collection of type That resulting from applying the given function f to each element of this map and collecting the results.
You are reading the wrong map function. Def map B (f: ((A, B)) ⇒ B) : MapB But you are using: def map B, That (f: ((A, B)) ⇒ B)(implicit bf: CanBuildFromMapA, B, B, That) : That Since you are returning a String you are not using the fist but the second. And for it the ScalaDoc says: "a new collection of type That resulting from applying the given function f to each element of this map and collecting the results.
That sort of make sense. But I think the docs could be clearer at this point, since the "use case" that was supposed to simplify the understanding of these complex method signatures actually makes it more confusing in this case. The results are intuitive though, which may be most important.
– Knut Arne Vedaa Sep 28 '10 at 12:26 1 They are both the same function. As retronym points out, the simpler one is an incorrect @usecase. – Ben Lings Sep 28 '10 at 18:35.
The @usecase addition to Scaladoc was fairly hastily conceived and implemented, and has a few wrinkles. In this case, the use case is defined in the Scaladoc for TraversableLike#map: @usecase def mapB(f: A => B): $CollB $Coll is replaced with simple text substitution, using the value defined in scala.collection.Map. /** * @define Coll Map * @define coll map */ object Map extends MapFactoryMap What could be done about this?
Perhaps the result of the text substitution could be type checked, which would rule out these edge cases.
The @usecase addition to Scaladoc was fairly hastily conceived and implemented, and has a few wrinkles. $Coll is replaced with simple text substitution, using the value defined in scala.collection.Map. What could be done about this?
Perhaps the result of the text substitution could be type checked, which would rule out these edge cases.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.