a) Please define a function map2 f l1 l2 applying the one-argument function f
to all elements of l1 i l2. Example:
> map2 (+) [1,2,3] [8,9,10]
[9,11,13]
b) Please define a function filter p l, whose value is the list of all elements of l
fulfilling the one-argument predicate p.
c) Please define a function take_while p l that returns a list of elements of list l (starting from
the left) until the first failure of predicate p. Examples:
>take_while odd [1,3,5,6,7]
[1,3,5]
> take_while (\x -> x > 0) [1,4,2,-1,5]
[1,4,2]
d) Please define a function groups l that will append consecutive identical elements from list l. Example:
>compress [1,1,3,3,3,3,2,2,2,2,2,7,7,2,2]
[[1,1],[3,3,3,3],[2,2,2,2,2],[7,7],[2,2]]