Add #foldRight and #scanRight functions.