The penultimate solution for problem 19 of Ninety-Nine Haskell Problems is giving the result for the opposite of the given N.e.g.
rotate "abcdefgh" (-3) gives the result for
rotate "abcdefgh" 3
I think it could be solved like this:
rotate xs n
| n <= 0 = (reverse . take (negate n) . reverse $ xs) ++ (reverse . drop (negate n) . reverse $ xs)
| n > 0 = (drop n xs) ++ (take n xs)
I know it's not great, just keeping the spirit of the original solution
Is this the right list for reporting this kind of bugs?
Nicolás