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
A proper explanation is lacking, but...
Some sketches in Haskell of what I'm hoping to create:
Two "BiFunction"s combined
So, carve some time and see if there's a way to emulate a pattern like this in Java