Simple List Question

Hello Little Problem, hope that somebody can help me I have a list
main [(1,2,3),(4,5,6),(3,4,5)]
and i want all Elements at the 1. Pos. in new List:
[1,4,3]
Thanks for help -- View this message in context: http://www.nabble.com/Simple-List-Question-tf1880239.html#a5139831 Sent from the Haskell - Haskell-Cafe forum at Nabble.com.

Jenny678 wrote:
Hello
Little Problem, hope that somebody can help me
I have a list
main [(1,2,3),(4,5,6),(3,4,5)]
and i want all Elements at the 1. Pos. in new List:
[1,4,3]
Thanks for help
Hello Jenny, and welcome to haskell-cafe. I will hazard a guess that this resembles a homework problem, so http://www.haskell.org/hawiki/HomeworkHelp applies. It appears you need to change [(Int,Int,Int)] into [Int]. How would you get the first element of a single tuple (1,2,3) ? Then, how would you do this for each member of the list? -- Chris
participants (3)
-
Chris Kuklewicz
-
Jenny678
-
Neil Mitchell