Haskell
Map and Filter
6. Let f1 = filter ( x -> x > 0) and f2 = filter (x-> x < 10), and let nbrFilter g x = length (filter g x).
a. Rewrite f1(f2[-5..15]) so that it uses function compositionto apply just one function to the list.
b. Rewrite the nbrFilter function definition to have theform
nbrFilter g = function composition involving length and filter …and leaving out x.
Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!
(Save $1 )
One time Pay
(Save $5 )
Billed Monthly
*First month only
You can see the logs in the Dashboard.