If I declare this F# function:
let extractColumn col (grid : List<Map<string, string>>) =
List.map (fun row -> row.[col]) grid
the compiler complains:
error FS0752: The operator 'expr.[idx]' has been used on an object of indeterminate type based on information prior to this program point. Consider adding further type constraints
Adding a type annotation for the lambda's row parameter fixes it:
let extractColumn col (grid : List<Map<string, string>>) =
List.map (fun (row : Map<string, string>) -> row.[col]) grid
Why can't it get the type of row from the extractColumn function's grid parameter?