I need some help to solve a task on function composition in Haskell. I need to write a function that given an Integer n
and a list of inner lists of elements, returns the list of n-th
element in each inner list. So it would be like:
select 2 [[2,3,4],[5,6],[9,9,9]] = [3,6,9]
. The thing is, I need to write it using function composition so it should look like select = ...
. In other words, I want to make this point-free.
For now, I have the following:
select::Int->[[Int]]->[Int]
select a = map $ head. reverse. take a
I'm stuck with it, I don't know how to remove those a
from the first and only clause. Can anybody help me with this?:)