Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
リストの要素を二乗する方法は知っていますが、リストのリストを二乗する方法は?
リストの要素を二乗するには、たとえば次のように使用できます。
List.map (fun x -> x*x) [1; 2; 3];;
リストのリストでこれを行う方法は?
[[1; 2]; [2; 3]] --> [[1; 4]; [4; 9]]
また
[[1; 2; 3]; [4; 2; 0]] --> [[1; 4; 9]; [16; 4; 0]]
例えば。
ありがとう