a. Study the code fragment below and identify the operation it provides. Then rewrite it using map and filter, and name it as q1f1a.
q1f1 :: [Int] -> [Int]
q1f1 [] = []
q1f1 (x:xs) | x < 3 = q1f1 xs
| x > 10 = q1f1 xs
| otherwise = x*3 : q1f1 xs
b. Now rewrite q1f1
using list comprehensions and name it as q1f1b.
c. Express the comprehension
[f x | x <- xs, p x]
as a function using the functions map and filter. Call the function compre
:
compre :: [a]->(a->b)->(a->Bool)->[b]
compre xs f p = … --using map and filter