[Haskell-cafe] elemt from list

Christian Maeder maeder at tzi.de
Tue Jan 27 11:09:27 EST 2004


The pattern "[x]" only matches singleton lists.

Pajo Patak wrote:
> 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



More information about the Haskell-Cafe mailing list