[Haskell-cafe] elemt from list

Bayley, Alistair Alistair_Bayley at ldn.invesco.com
Tue Jan 27 09:54:03 EST 2004

There is a Prelude function "!!" which I think would do what you want:


You may find other useful list functions in this library...

> -----Original Message-----
> From: Pajo Patak [mailto:brutalbanal at hotmail.com]
> Sent: 27 January 2004 09:32
> To: haskell-cafe at haskell.org
> Subject: [Haskell-cafe] elemt from list
> I want  to return a list, from and list of lists (all 
> integers), where is 
> the erroe in the code?
> nthList :: [[a]] -> Int -> [a]
> nthList ([x]:xs) 1     = [x]
> nthList ([x]:xs) (n+1) = nthListh xs n

Confidentiality Note:  The information contained in this 
message, and any attachments, may contain confidential 
and/or privileged material.  It is intended solely for the 
person(s) or entity to which it is addressed. Any review, 
retransmission, dissemination, or taking of any action in 
reliance upon this information by persons or entities other 
than the intended recipient(s) is prohibited. If you received 
this in error, please contact the sender and delete the 
material from any computer.

This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit

More information about the Haskell-Cafe mailing list