Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"without generics it's hard to do much useful with lambdas in your statically typed language"

I challenge you to read the source for the Go standard library and maintain that position. Lambdas are orthogonal to generics in pretty much every aspect. You need to stop thinking in terms of "filter or map". Programming languages that didn't include these idioms existed long before Go, and will exist long after Go.

I welcome the introduction of generics, but I still don't have many places in many code-bases where they'll be used.



Map is a pretty fundamental thing you might want to do to your data structures (and more). Look up all the places that Haskell's "Functor" pops up for example.

Filter is much more limited in where it's applicable, that's true.

In any case, I already gave another example in my comment: sorting. And sorting's API is done terribly in the Go standard libraries.

The Go standard library does a lot with callbacks; and yes, it manages to get something useful out of them via something even uglier: mutation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: