Sorry about the vague title, but part of this question is what these two syntax styles are called:
let foo1 x = match x with | 1 -> \"one\" |
function only allows for one argument but allows for pattern matching, while fun is the more general and flexible way to define a function. Take a look here: http://caml.inria.fr/pub/docs/manual-ocaml/expr.html