fstLib.fst : ('a * 'b) -> 'a
Extracts the first component of a pair.
fst (x,y) returns x.
Never fails. However, notice that fst (x,y,z) fails to
typecheck, since (x,y,z) is not a pair.
> fst (1, "foo");
val it = 1: int
> fst (1, "foo", []);
Exception- Type error in function application.
Function: fst : 'a * 'b -> 'a
Argument: (1, "foo", []) : int * string * 'a list
Reason:
Can't unify 'a * 'b to int * string * 'a list
(Different number of fields)
Fail "Static Errors" raised
> fst (1, ("foo", []));
val it = 1: int