
There is a Prelude function "!!" which I think would do what you want: <http://haskell.org/ghc/docs/latest/html/libraries/base/Data.List.html#v%3A! !> You may find other useful list functions in this library...
-----Original Message----- From: Pajo Patak [mailto:brutalbanal@hotmail.com] Sent: 27 January 2004 09:32 To: haskell-cafe@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 http://www.messagelabs.com ________________________________________________________________________