Comment

Comment by patrickthebold

Scala has a lot of 'sugar':

f(...) becomes f.apply(...)

matching calls unapply with some various binding.

Some parenthesis are optional: Some(1,2,3) is Some((1,2,3))

optional . so a + b is a.+(b)

colon changes associativity, so a +: b is b.+:(a)

for expressions become, map, flatMap, filter, withFilter and forEach, according to various rules.

def f[A: B]() adds an implicit parameter of type B[A]

I'm sure there's more but that's the top of my head. Of course it's not actually a long list, but none of that is obvious for a newcomer.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton