It's not clear what programming language is being used in this blog entry from April 2014, but it does show a trick or two using a higher level function as input to the foldr recursive function.
This feels like it has some examples of how to use it and how NOT to use it, but there is some confusion expressed by the writer as well.
It's not stated anywhere, but it's Haskell. Usually a safe bet when presented with a functional programming language that is not lisp-like normuses a c-like syntax.
dropWhile :: (a -> Bool) -> [a] -> [a]
dropWhile p [] = []
dropWhile p xs@(x:xs')
I feel that dropWhile isn't that kind of operation fold was designed for.EDIT: I was somewhat wrong. After some googling I found this clever implementation :
dropWhilePair :: (a -> Bool) -> [a] -> ([a], [a])
dropWhilePair p = foldr f v
But this returns a tuple whose first element is the answer we need.