add - ocaml sum of two lists with different length -
I tried to add two lists with different lengths:
sumList (a , B) = Match A, with B [], _ - & gt; [] | (X :: Xs, Y :: YS) - & gt; (X + Y) :: Defile List (Xs, YS) This unbound value returns the ratios, is it possible that Haskell: zipWith (+) a Perhaps the actual error is "unbound value defaulter" because you have diffList in your code.
. If this is a transcription error, then the next problem is that you sum list as a recursive function: REC list (A, B) = .. . .
The match of your pattern is not complete if the first list is long, then it fails.
Haskell is friendly with zipWith Okamax List.map2 , for which lists are required length. I do not think anything is acceptable in the Okamam standard library.
Comments
Post a Comment