开发者

Does Go have the standard functional primitives?

Does the stan开发者_高级运维dard library (or a popular agreed-upon library) let me map, filter, fold etc. over slices/maps?


No. Go's type system doesn't cater for the usual form of these primitives because it lacks generics.

See also this thread on golang-nuts.


While Go does not have these primitives, it should be pointed out that the standard Go abstraction of a goroutine that you talk to through a channel will trivially give you entirely equivalent functionality in an asynchronous function.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜