Created
June 8, 2010 11:00
-
-
Save bastos/429868 to your computer and use it in GitHub Desktop.
First lines of OCaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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