index : ('a -> bool) -> 'a list -> int
- index (equal 3) [1,2,3]; > val it = 2 : int - let fun even i = (i mod 2 = 0) in try (index even) [1,3,5,7,9] end; Exception raised at Lib.index: no such element ! Uncaught exception: ! HOL_ERR - index (equal 3 o hd) [[1],[],[2,3]]; ! Uncaught exception: ! Empty