問題は、2つのリストを入力し、他のリストの対応する番号に従って最初のリストの要素を繰り返すことです。例repeat([2,3,4],[1,2,2])
:[2,3,3,4,4]
fun repeat1(a,b)=if b>0 then a::repeat1(a,b-1) else [];
fun repeat([],[])=[]
|repeat([l1],[m1])=repeat1(l1,m1)
|repeat(l1::ln,m1::mn)=if length(l1::ln)=length(m1::mn) then if ln<>[] then repeat1(l1,m1)@repeat(ln,mn) else [] else [];
エラーは言う
stdIn:36.64-36.66 Warning: calling polyEqual
stdIn:34.5-36.112 Warning: match nonexhaustive
(nil,nil) => ...
(l1 :: nil,m1 :: nil) => ...
(l1 :: ln,m1 :: mn) => ...
これらは何のためにありますか(基本ケースと帰納的ケースでは十分ではないことを私は知っています)?しかし、これがプログラムの出力に影響を与えない場合でも、この警告を削除するにはどうすればよいですか?ありがとう。