Ta fonction ne répond pas du tout à la spécification. Voici un exemple:
utop[2]> mapcan (fun x -> [x; x * x]) [1; 2; 3];;
- : int list = [1; 1; 2; 4; 3; 9]
ta fonction donne:
- : int list list = [[1; 1]; [2; 4]; [3; 9]]
utop[2]> mapcan (fun x -> [x; x * x]) [1; 2; 3];;
- : int list = [1; 1; 2; 4; 3; 9]
ta fonction donne:
- : int list list = [[1; 1]; [2; 4]; [3; 9]]