Add createWithFoldLeft constructor

(cherry-picked from dc693fe765716a074e95c36970a6bece0ac88215)