<DIV>>> I am stuck on an exercise in a haskell book (the craft of functional<BR>>> programming) chapter 7 exercise 7.18 I have to write a function to <BR>check<BR>>> does one list occur as a subsequence of another, i am having real<BR>>> difficulty trying to do this. I have a method which will tell me if <BR>one<BR>>> character occurs in the list but it won't work for a list of <BR>>>characters.<BR>>> the function should look like isSubsequence :: [chars] -> [chars] -><BR>>> boolean<BR>>><BR><BR>>Try writing a list or string equality function first? That may help.<BR></DIV>
<DIV>Thanks for getting back to me, have written this so far</DIV>
<DIV> </DIV>
<DIV>find :: [Char] -> Char -> Bool<BR>find [] n = False<BR>find (x:xs) n<BR> | x == n = True<BR> | otherwise = find xs x</DIV>
<DIV> </DIV>
<DIV>this will work to find if one character appears in a list but i dont understand how to call this recursively to find if a list occurs within a list. I have tried writing another function to call this but it won't work. Does anyone have a solution?</DIV>
<DIV> </DIV>
<DIV>thanks again</DIV>
<DIV> </DIV>
<DIV> </DIV><BR><BR><DIV>
<DIV>
<P><FONT face=courier><STRONG>Peter Stranney<IMG src="http://us.i1.yimg.com/us.yimg.com/i/mesg/tsmileys2/04.gif"></STRONG></FONT></P></DIV></DIV><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com