final fold as functor