\DOC assoc2 \TYPE {assoc2 : ''a -> ('b * ''a) list -> ('b * ''a)option} \SYNOPSIS Searches a list of pairs for a pair whose second component equals a specified value. \KEYWORDS list. \DESCRIBE An invocation {assoc2 y [(x1,y1),...,(xn,yn)]} returns {SOME (xi,yi)} for the first {(xi,yi)} in the list such that {yi} equals {y}. Otherwise, {NONE} is returned. The lookup is done on an eqtype, i.e., the SML implementation must be able to decide equality for the type of {y}. \FAILURE Never fails. \EXAMPLE { - assoc2 2 [(1,4),(3,2),(2,5),(2,6)]; > val it = SOME (3, 2) : (int * int) option } \SEEALSO Lib.assoc, Lib.assoc1, Lib.rev_assoc, Lib.mem, Lib.tryfind, Lib.exists, Lib.all. \ENDDOC