Question: Define a Haskell function named addUs that adds 2 input numbers. Using this function as a building block, define a Haskell function multiplyUs that multiplies
Define a Haskell function named addUs that adds input numbers. Using this function as a building block, define a Haskell function multiplyUs that multiplies two input numbers. The multiplyUs function should cater to the following:
Inputs may be signed numbers, eg multiplyUs should result in and multiplyUs should result in
It should use guard expressions and recursion.
There is no need to write the main function to perform user interaction. Writing the definition for addUs and multiplyUs is sufficient.
Explain the type signature for your code.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
