3 ms·
there are first class functions, and closures work the way you would expect. Since it's statically typed and there are no generics, there's no way to implement
by zemo 13y ago
there are first class functions, and closures work the way you would expect. Since it's statically typed and there are no generics, there's no way to implement something like a left fold; you'd have to implement it on a per-type basis, but you could certainly do that. I believe the answer you're looking for is "no", but Go's functions are nothing to sneeze at. http://jordanorelli.tumblr.com/post/42369331748/function-types-in-go-golang http://jordanorelli.tumblr.com/post/42369331748/function-typ...
- masklinn 13y ago> you'd have to implement it on a per-type basis Alternatively you can implement everything on interface{} and force the user of the higher-order function to use type assertions everywhere.