• + 0 comments

    haskell :

    rev [] = []
    rev [x] = [x]
    rev xs = lastPart : rev initPart
      where lastPart = last xs
            initPart = init xs