Skip to content

Instantly share code, notes, and snippets.

@bastos
Created June 8, 2010 11:00
Show Gist options
  • Save bastos/429868 to your computer and use it in GitHub Desktop.
Save bastos/429868 to your computer and use it in GitHub Desktop.
First lines of OCaml
let rec find needle l =
match l with
[] -> false
| hd :: tl ->
if hd = needle then true
else find needle tl;;
Printf.printf "Result = %b\n" (find 100 [10;1;2;3;4])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment