Search code examples
c#scalaprogramming-languages

Why double arrow for Scala and C# lambdas?


Does anyone know some background, why Scala and C# use double arrow (=>) for lambdas instead of single arrow (->)?

Single arrow is more common in literature, is used in Haskell, O'Caml, F#, Groovy etc. and IMO it also looks nicer :)


Solution

  • Pizza, which was sort of a predecessor for Scala had -> in function types. I remember that C++ programmers were baffled by this choice of symbol. That's the primary reason why Scala chose => AFAIRC. It seems the C# guys went through the same reasoning.