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

Currying types for deep fusions #19

Open
booniepepper opened this issue Jun 23, 2021 · 1 comment
Open

Currying types for deep fusions #19

booniepepper opened this issue Jun 23, 2021 · 1 comment

Comments

@booniepepper
Copy link
Collaborator

booniepepper commented Jun 23, 2021

A proper explanation is lacking, but...

Some sketches in Haskell of what I'm hoping to create:

Two "BiFunction"s combined

-- Single BiFunction
fused a b = f a b
fused = f

-- Two BiFunctions
fused a b c = g (f a b) c
fused = (g .) . f

fuse f g = (g .) . f
fuse = flip ((.) . (.))

-- Three BiFunctions
fused a b c d = h (g (f a b) c) d
fused = (((h .) . g) .) . f

fuse f g h = (((h .) . g) .) . f
fuse = flip (flip . (((.) . (.)) .) . flip ((.) . (.)))

-- Four BiFunctions
fused a b c d e = i (h (g (f a b) c) d) e
fused = (((((i .) . h) .) . g) .) . f

fused f g h i = (((((i .) . h) .) . g) .) . f
fuse = flip (flip . ((flip . (((.) . (.)) .)) .) . flip (flip . (((.) . (.)) .) . flip ((.) . (.))))

So, carve some time and see if there's a way to emulate a pattern like this in Java

@booniepepper
Copy link
Collaborator Author

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

No branches or pull requests

1 participant