What is => called in Scala?

I remember having read the term "rocket" somewhere, probably in the book Programming Scala by Dean Wampler and Alex Payne. I found this related answer from Bill Venners on a forum:

I asked Martin Odersky a while back what he called this, and he said "right arrow". Ron Hitchens suggested the name "bullet" to me a couple months ago. I used that here and there, but it didn't seem to stick. About 2 weeks ago I asked some Ruby guys what they call it, and they said "hash rocket". The reason for "hash" is Ruby uses it for mapping keys to value, i.e., "key => value" in Ruby is like "key -> value" in Scala (but untyped in Ruby), and of course -> in Scala is a library abstraction, not part of the language.

So I suggest we call it "rocket". It's more exciting and less violent than bullet, and we can put an adjective in there to differentiate the various uses in Scala: there's "function rocket" in anonymous functions, maybe a "case rocket" in a case clause in match expression or partial function, etc.

So the "official" term used by Odersky is "right arrow".


In the scala docs (A Scala Tutorial for Java Programmers) it is referred as right arrow


In Book, Programming in Scala by Martin Odersky, Lex Spoon, Bill Venners it is mentioned as Right arrow or Rcket

=> (right arrow, or “rocket”)

  • in function literals, 68

  • in import statements, 270–271

  • in self types, 563

  • in match alternatives, 164

  • in this aliasing, 659


Also commonly called "fat arrow"

UPDATE: oh I just noticed that Paolo Falabella mentioned it in a comment above. Whatever, it is just as as well to have a proper answer here as "fat arrow" is indeeed a very common name for it.

Tags:

Scala