This a function seconds that takes a list of pairs and returns a list of the first objects in the pairs.
fun seconds (pairs : (a * b) list) : b list =
let
fun first (pair : a * b) : a = fst pair
in
map first pairs
end;
val pairs = [("m", false), ("w", false), ("n", true)];
val result = seconds pairs;
Error:
Elaboration failed: Unbound type "a"
The error I'm having is that 'a' is an unbound value.
I tried fixing the code by adding parenthesis around a or removing the a in other parts and I ended up with the same error.
As noted in comments, type variables begin with
'.Of course, all of this type annotation is unnecessary. Let type inference do its work.
And this is really just a very verbose way to write: