Question: Haskell Programming - Code Do it in Haskell GHCI Lambda Functions 7. (8 = 6+2 points) a. Rewrite fgxy = gx (y x) three ways,
Haskell Programming - Code
Do it in Haskell GHCI


Lambda Functions 7. (8 = 6+2 points) a. Rewrite fgxy = gx (y x) three ways, first f gx= unnamed lambda function, then fg=unnamed lambda function, and finally f = unnamed lambda function. b. Briefly, how does var = lambda function relate to first-class functions in Haskell? List Folding 8. (6= 3 * 2 points) Let's re-implement the foldl function in multiple ways. Your foldl only needs to work on lists. a. Write a definition for foldl using conditional expressions: foldlifax= if x == ( ) then etc. b. Rewrite the definition using function definition by cases: fold12 ... Rewrite the definition using a case expression: foldl3 fax= case x .... Lambda Functions 7. (8 = 6+2 points) a. Rewrite fgxy = gx (y x) three ways, first f gx= unnamed lambda function, then fg=unnamed lambda function, and finally f = unnamed lambda function. b. Briefly, how does var = lambda function relate to first-class functions in Haskell? List Folding 8. (6= 3 * 2 points) Let's re-implement the foldl function in multiple ways. Your foldl only needs to work on lists. a. Write a definition for foldl using conditional expressions: foldlifax= if x == ( ) then etc. b. Rewrite the definition using function definition by cases: fold12 ... Rewrite the definition using a case expression: foldl3 fax= case x
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
