fork download
  1. let l = [1;2;3;4;5] ;;
  2.  
  3. let rec mem list element = match list with
  4. | [] -> false
  5. | head :: _ when head = element -> true
  6. | _ :: tail -> mem tail element
  7. ;;
  8.  
  9. Printf.printf "%B \n" (mem l 3)
  10.  
  11.  
Success #stdin #stdout 0s 4196KB
stdin
Standard input is empty
stdout
true