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
looks good to me (of course together with rev  = ). Can anyone say something about compared efficiency with the foldl solutions?