Question: Please answer question (2) In Haskell with Code with main to test the function weighs 1370 01 place. Ihe assignment COLISIsung 01 all ou for

Please answer question (2) "In Haskell" with Code with main to testPlease answer question (2) "In Haskell" with Code with main to test the function

weighs 1370 01 place. Ihe assignment COLISIsung 01 all ou for the class. (1) Define the following in Haskell: (a) A function checksum::Int -> Int -> Int -> Bool that evaluates to True on input a, b and c if and only if a +b = c. (b) A function higherchecksum: : (Int -> Int) -> Int -> Int -> Int -> Bool that evaluates to True on input f, a, b and c if and only if f(a) + f(b) = f(c). For (b) check that the provided tests evaluate to True. (2) Define a function notdivisible:: Int -> Int -> Bool that evaluates to True on input a and b if and only if a is not divisible by b (in particular, if b == 0). Test this function by entering the following expression into ghci: filter (\x -> notdivisible x 2) [0..100] Play with the expression in order to understand what is happening. (3) The following Haskell expression defines the list of integers from 0 to 1000: list = [x | x Int that computes for any positive integer n the squared factorial (n!)2 == (1 * ...* n)? (b) What happens if you run the program on input 50? Explain! (answer to part (b) does not need to be submitted)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!