Work around the absence of Data.Map.foldl' in containers < 4.2