I created my own drop' function like this:drop' :: Int -> [a] -> [a]drop' 0 xs = xsdrop' n [] = []drop' n (x:xs) = drop' (n - 1) xsBut in the Haskell book I am reading it is written like this:drop' :: Int -> [a] -> [a]drop' 0 xs = xsdrop' (n + 1) [] = []drop' (n + 1) (x:xs) = drop' n xsMy version seems to work but I am concerned about my third line (drop' n [] = []). Is that a problem?Why does this author use n + 1 as a parameter as opposed to n - 1 like I do in body?Or does it make no difference?
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners