• + 1 comment

    This is pretty inefficient haskell, as you have to traverse the entire list and make a copy of it each time you use the ++ operator. A more efficient solution is rev = foldl (\acc x -> x : acc) []. this way, you avoid the expense of using the ++ operator