1\DOC assoc2 2 3\TYPE {assoc2 : ''a -> ('b * ''a) list -> ('b * ''a)option} 4 5\SYNOPSIS 6Searches a list of pairs for a pair whose second component equals a specified 7value. 8 9\KEYWORDS 10list. 11 12\DESCRIBE 13An invocation {assoc2 y [(x1,y1),...,(xn,yn)]} returns {SOME (xi,yi)} 14for the first {(xi,yi)} in the list such that {yi} equals 15{y}. Otherwise, {NONE} is returned. The lookup is done on an eqtype, 16i.e., the SML implementation must be able to decide equality for the 17type of {y}. 18 19\FAILURE 20Never fails. 21 22\EXAMPLE 23{ 24- assoc2 2 [(1,4),(3,2),(2,5),(2,6)]; 25> val it = SOME (3, 2) : (int * int) option 26} 27 28 29\SEEALSO 30Lib.assoc, Lib.assoc1, Lib.rev_assoc, Lib.mem, Lib.tryfind, Lib.exists, 31Lib.all. 32 33\ENDDOC 34