by pjmlp · 4y ago · 0 comments
records := Stream.Limit(User, 10)
records.Select(func(user User) bool {return user.IsAdmin()}).Map{func(user User) string { return fmt.Sprintf("%d %s", user.id, user.name) }
Yes a bit more verbose, that is the price to pay for static typing without full type inference as in the ML language family.https://go.googlesource.com/proposal/+/master/design/go2draf...
records.collect({case u if u.isAdmin => s”${u.id} ${u.name}”}).take(10) guess the language
That line of code could be Scala, or something else.
In any case, the point is that there are compiled languages that offer similar productivity like Ruby, with AOT/JIT compilers out of the box, and great IDE experiences.