Skip to content
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

try optimaze Partial #593

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

alkiller22
Copy link

@alkiller22 alkiller22 commented Feb 18, 2025

feat: refactor Partial functions into an object-oriented approach && add PartialR functions

would like use Partial like:

    	type myInt1 int
	type myInt2 int
	type myInt3 int
	type myInt4 int
	type myInt5 int
	type myInt6 int
	type myInt7 int
	type myInt8 int
	type myInt9 int
	type myInt10 int
	add := lo.MFunc10(func(a myInt1, b myInt2, c myInt3, d myInt4, e myInt5, f myInt6, g myInt7, h myInt8, i myInt9, j myInt10) int {
		return int(a) + int(b) + int(c) + int(d) + int(e) + int(f) + int(g) + int(h) + int(i) + int(j)
	})
	_ = add.
		Partial(1).
		Partial(2).
		Partial(3).
		Partial(4).
		Partial(5).
		Partial(6).
		Partial(7).
		Partial(8).
		Partial(9).
		Partial(10)() == add.PartialR(1).
		PartialR(2).
		PartialR(3).
		PartialR(4).
		PartialR(5).
		PartialR(6).
		PartialR(7).
		PartialR(8).
		PartialR(9).
		PartialR(10)()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant