I am trying to reverse a list.
Following is my code:
reverseList :: [Int] -> [Int] reverseList [] = [] reverseList (x:xs) = x:reverseList xs
Simple; use the built-in reverse function:
reverse
print (reverse [1,2,3,4,5]) -- [5,4,3,2,1]