-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use generics from go 1.18 #147
Comments
@GRbit yes, I would accept PRs and I'm currently working on a |
Looking forward to this. Greatly appreciated |
I‘ve just gone through the exercise and replaced funk by generics, mainly /x/exp/slices, which proved for my uses straightforward. The main omission in Go regarding slices is missing Map/ Reduce/ Filter afaikt. |
@thoas create please v2 branch so it became possible to contribute. |
@metalrex100 I will, it will be available next week :) |
@thoas is there any functions that you did not implement so far with generics? |
Note golang/go#45955 (comment) which links https://github.com/luraim/fun |
Hum, when @thoas told that branch with generics will be available for contribution V2 branch with generics support could be released asap, so interested in generics community would provide PR's for helpers they are interested in. Instead currently everyone, who wants to use generics helpers, but would like to use it with well-known package instead of self-written implementation are blocked by maintainers of the go-funk and lo packages. IMO if you are an author of the demanded by community package and you don't have time to actively maintain package - need to find more maintainers. |
I don't feel blocked. Instead I can continue using this excellent module or move to any generics-based package including my ohne patches until something more mature comes up. Big thank you to @thoas for all his work sofar. |
@andig when codebase is pretty big - it require to spend much time on replacing your self-written solutions with some well-known package. |
Yes, it takes more time than expected I will have a first draft a the end of the week. I have created a I don't want to rush it, since it will be a complete rewrite and a lot of BC :) |
@thoas it will be actually almost another lib. Methods names will be still the same)) |
Yes, that's why it will be separated to a complete new branch and installed via gomod using |
@thoas indeed. New implementation also must be placed in |
Or you want to deal with versioning by always having 2 branches instead of single master with 2 directories: root and v2? |
branches will be used to separate implementations between generics and non-generics, the same way go-redis is doing it for example. People will be able to send PRs on |
Two weeks passed . @thoas |
@gopherhw I know, lack of time :) |
Is there any progress on this? |
@yangxikun to be honest, zero from my side. I switched to github.com/samber/lo |
You can switch to samber/lo which is pretty complete. |
It's 1.18 now.
Are you planning update your code to use generics? It will improve speed dramatically.
I know that some of the functions can't be properly updated due to the fact that interfaces are more flexible than generics, but there are a lot of functions that could be updated. And because of https://pkg.go.dev/golang.org/x/exp/maps and https://pkg.go.dev/golang.org/x/exp/slices some functions aren't useful right now. So, there are a lot of work =)
Will you accept any pull requests with generics?
The text was updated successfully, but these errors were encountered: