You are viewing a single comment's thread. Return to all comments →
rev l = last l : (rev $ init l)
It will cause an error when getting last  or init .
rev l = reverse l
Fwiw, also rev = reverse works, but this is just copying.
looks good to me (of course together with rev  = ). Can anyone say something about compared efficiency with the foldl solutions?