- : int = 1
-1. Which of the following expressions is well-typed in OCaml?
- For those that are, give the type of the expression as a whole.
- For those that are not, why not?
+1. Which of the following expressions is well-typed in OCaml? For those that are, give the type of the expression as a whole. For those that are not, why not?
let rec f x = f x;;
= λf :σ → τ. λl:σ list. l [τ list] nilτ (λx:σ. λy:τ list. consτ (f x) y
**Excercise** convert this function to OCaml. Also write an `append` function.
-Also write a **head** function. Test with simple lists.
+Also write a **head** function. Also write nil??? Test with simple lists.
Consider the following simple binary tree type: