This page is no longer maintained — Please continue to the home page at www.scala-lang.org

scaladoc notation

2 replies
kxen
Joined: 2009-03-01,
User offline. Last seen 2 years 10 weeks ago.

Is there FAQ I can go to that could explain the scaladoc notations? I'm don't
come from a field where neither this:
intersect [B >: A](that : List[B]) : List[B]
nor this:
flatMap [B](f : (A) => Iterable[B]) : List[B]
ever show up.

Based on I what I know of the language I have a wishy-washy feel for what those
snippets state. But I would rather understand what I am reading than have this
nagging uncertainty.

Thanks.

vpatryshev
Joined: 2009-02-16,
User offline. Last seen 1 year 24 weeks ago.
Re: scaladoc notation
It depends a lot on your background. If you are a Java programmer, transition is easy. If you know Haskell (sigh), or happen to know what lambda-cube is, translation is kind of trivial; otherwise some efforts are required. Not sure if C++ templates could be a good prototype, maybe they just give a general idea regarding how things work.
2009/3/21 kxen <biznezonly@mac.com>
Is there FAQ I can go to that could explain the scaladoc notations? I'm don't
come from a field where neither this:
        intersect  [B >: A](that : List[B]) : List[B]
nor this:
        flatMap  [B](f : (A) => Iterable[B]) : List[B]
ever show up.

Based on I what I know of the language I have a wishy-washy feel for what those
snippets state. But I would rather understand what I am reading than have this
nagging uncertainty.

Thanks.




--
Thanks,
-Vlad
Jan Lohre
Joined: 2008-12-17,
User offline. Last seen 42 years 45 weeks ago.
Re: scaladoc notation
I am not sure what you a referring to. This is no special scaladoc notation, it's as I see it pretty much the signature of the mentioned methods.

[B >: A] means B is a supertype of A
f : (A)=>Iterable[B] is a function with a parameter of type A and a return parameter Iterable[B]

But I am not sure at all that I answered your question.

Why did you remove the complete context? I guessed its taken from class List[A].

Kind regards,
Jan

2009/3/21 kxen <biznezonly@mac.com>
Is there FAQ I can go to that could explain the scaladoc notations? I'm don't
come from a field where neither this:
        intersect  [B >: A](that : List[B]) : List[B]
nor this:
        flatMap  [B](f : (A) => Iterable[B]) : List[B]
ever show up.

Based on I what I know of the language I have a wishy-washy feel for what those
snippets state. But I would rather understand what I am reading than have this
nagging uncertainty.

Thanks.


Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland