scanr package:foldl

Like scan but start scanning from the right