Backport #3284 : Lazy initial value for fold

(Wait for backport-3091)