def bracket_matches(program):
    """Returns a dict with positions for matching brackets.

    e.g.:
    >>> bracket_matches("++[-,.[+>>]]")
    {
        2: 11,
        6: 10
    }
    """
    opening_pos = []
    matches = {}
    for pos, instr in enumerate(program):
        if instr == "[":
            opening_pos.append(pos)
        if instr == "]":
            opening = opening_pos.pop()
            matches[opening] = pos
            matches[pos] = opening
    return matches