wrestling with foldr