Question: The function make_assoc : string list list -> (int*int*string) list should translate a list of lists of strings into associative form : the list [[s11;...;s1k];
The function make_assoc : string list list -> (int*int*string) list should translate a list of lists of strings into associative form: the list [[s11;...;s1k]; [s21;...;s2m];...[sN1;....;sNl]] should be translated to [(1,1,s11);...;(1,k,s1k);(2,1,s21);...;(2,m,s2m);...;(N,1,sN1)...;(N,l,sNl)]. Some concrete evaluations:
make_assoc [] and make_assoc [[]] should both evaluate to []
make_assoc [["a"]] should evaluate to [(1,1,"a")]
make_assoc [["a";"b"];["c"]] should evaluate to (a permutation of) [(2,1,"c"); (1,2,"b"); (1,1,"a")]
It should follow as below:
| (* translate a string list list into associative form, i.e. *) | |
| (* a list of (row, column, entry) triples *) | |
| let make_assoc rc_list = [] |
Need some help with this. Thank you.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
