Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mdw-go/funcy
Functional programming toolkit for Go
https://github.com/mdw-go/funcy
functional-programming generics golang mapreduce
Last synced: 22 days ago
JSON representation
Functional programming toolkit for Go
- Host: GitHub
- URL: https://github.com/mdw-go/funcy
- Owner: mdw-go
- License: mit
- Created: 2022-12-29T10:21:52.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-19T07:06:57.000Z (about 1 month ago)
- Last Synced: 2024-10-20T10:23:48.643Z (29 days ago)
- Topics: functional-programming, generics, golang, mapreduce
- Language: Go
- Homepage:
- Size: 98.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# github.com/mdw-go/funcy `[DEPRECATED]`
NOTE: the `funcy` package described first below has been deprecated, in effect having been replaced by the `funcy/ranger` package (describe farther below).
---
[![GoDoc](https://godoc.org/github.com/mdw-go/funcy?status.svg)](http://godoc.org/github.com/mdw-go/funcy)
What is this?
> A library providing functional-style operations like Map/Reduce/Filter (to name a few) implemented in Go w/ generics.
But Rob Pike [says we should just write for loops instead](https://github.com/robpike/filter)...
> Sorry, I guess [I just couldn't resist](https://twitter.com/codewisdom/status/1056162850220240896). I extend apologies to all the Go purists who are annoyed by this.
Are you aware that this approach lacks lazy evaluation, generates a ton of garbage, and won't scale for increasingly large inputs?
> Yup. I extend apologies to all the functional purists who are annoyed by this.
How would one install it? (Asking for a friend...)
> `go get github.com/mdw-go/funcy`
>
> Enjoy!---
# github.com/mdw-go/funcy/ranger
[![GoDoc](https://godoc.org/github.com/mdw-go/funcy/ranger?status.svg)](http://godoc.org/github.com/mdw-go/funcy/ranger)
Despite what I thought was a very cleverly written disclaimer (above), Go went and released version 1.23 with iterators, which means we can have our cake and eat it too, a phrase which here means that lazy evaluation is now possible and so we no longer need upset functional purists!
I'm not sure how Rob feels about all this, but I sincerely hope you do enjoy the `funcy/ranger` package, with [many accompanying examples](https://github.com/mdw-go/funcy/tree/main/ranger/examples).