reverse attempt

The problem is I need to be able to do accumulation. But I’m not sure
how to do that in Haskell!