Compact map uses fold to accumulate.