1

I have three functions.

function1 :: [Person] -> [String]

function2 :: String -> [Person] -> [(String, Int)]

function3 :: [String] -> [(String, Int)] -> [String]

I want the output of function1 and function2 to be passed to function3. E.g function3(function1 function2)

But function1 and function2 both have their own parameters so it'd look something like:

function3(function1([Person]) function2(String [Person]))

I've looked at function composition but that's when you feed the output of one function to another. In this case, I want to feed the output of two separate functions to another.

Thank you.

1 Answer 1

3

You don't need parentheses on your function calls. f (g h) means f applied to a single argument which is g h. You probably want function3 (function1 ...) (function2 ...) where ... is the arguments to each function.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.