<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I have a Scheme function that calculates sequence differences, i.e., it returns a sequence that is the difference between the 2nd and the 1st element, the 3rd and the 2nd, the 4th and the 3rd, etc.<br><br>(define s<br> (lambda (f l)<br> (cond ((null? (cdr l)) '())<br> (else (cons (f (cadr l) (car l))<br> (s f (cdr l)))))))<br><br>where<br><br>(s - '(0,1,3,6,10,15,21,28)) => (1,2,3,4,5,6,7)<br><br><br>I'm thinking the same function in Haskell would be something like<br><br>s :: <br>s f [] = []<br>s f [x] = [x] <br>s f l = [ a f b | (a,b) <- zip (init l) (tail l)]<br><br><br>but can't figure out what the function typing would
be.<br><br>Michael<br><br></td></tr></table><br>