-- :load "c:\\HaskellProgs\\chap7.hs" -- ------------------------------------------ -- 7.2 -- [f x | x <- xs, p x] map_filter f p xs = map f (filter p xs) test = map_filter (\x -> x+1) (\y -> y<6) [1,9,3,7,5] -- ------------------------------------------ -- 7.3 map' f = foldr (\x xs -> (f x):xs) [] test' = map' (\x -> x*2) [1,2,3,4] -- ------------ filter' p = foldr (\x xs -> if (p x) then x:xs else xs) [] test'' = filter' (\x -> x<6) [9,2,8,4]