[Haskell-cafe] Simple List Question

Chris Kuklewicz haskell at list.mightyreason.com
Sun Jul 2 09:21:19 EDT 2006

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?


More information about the Haskell-Cafe mailing list