Haskell (.) For a function with multiple operands

The operator (.) Has the signature:

 (.) :: (b -> c) -> (a -> b) -> a -> c (.) fgx = f $ gx 

This is a bit like a composition function in primitive recursive functions with one g.

I am not interested in expanding the number of g-functions, but (several) functions that apply the function (.) To a function g with several operands. In other words, something like:

 (..) :: (c -> d) -> (a -> b -> c) -> a -> b -> d (..) fgxy = f $ gxy 

A search on Hoogle does not lead to any function. Is there a package that can handle this with an arbitrary number of operands?

+6
source share
2 answers

To answer my comments:

Composition statements with multiple arguments are very easy to define, and fortunately, someone has already done this for you. The composition package has a good set of statements for you to use to create functions this way. I also found that instead of using the haskell.org

+6
source

Jasper van der Jugt has a common operator that does just that. Wed this blog post .

+2
source

Source: https://habr.com/ru/post/982535/


All Articles