-- Naive reverse in Haskell -- Concatenating two lists (predefined as `++' in the standard prelude) append [] ys = ys append (x:xs) ys = x : append xs ys -- Reverse the order of elements in a list in a naive manner: rev [] = [] rev (x:xs) = append (rev xs) [x] main = rev [1..10]