package spin

  1. Overview
  2. Docs

Source file list.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
include Stdlib.List

let index f t =
  let rec aux acc = function
    | [] ->
      raise Not_found
    | el :: rest ->
      if f el then
        acc
      else
        aux (acc + 1) rest
  in
  aux 0 t
OCaml

Innovation. Community. Security.