The function (.) :: (b -> c) -> (a -> b) -> a -> c
composes two functions which take only one argument each. I would sometimes find useful if the second function passed could take more than one argument:
(.) :: (b -> c) -> (a1 -> ... -> an -> b) -> a1 -> ... -> an -> c
If I use a function f
as below with more than one argument as the second argument, this is what happens:
(g . f) val1 ... valn = g (f val1) val2 ... valn
Whereas I would like:
(g . f) val1 ... valn = g (f val1 ... valn)
Is there an alternative to .
or another way to achieve this?