<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div>I wrote this code and Can it be less?<br>[2,4,5]
list is sub list of [3,7,<b>2,4,5</b>,9] list and return True but not of
[3,7,<b>4,2,5</b>,9] list ; return False<br><br>sublist :: Eq a => [a] -> [a] -> Bool<br>sublist [] _ = True<br>sublist (_:_) [] = False<br>sublist (x:xs) (y:ys)<br> | x == y = if isEqual (x:xs) (y:ys) == False<br> then sublist (x:xs) ys<br> else True<br> | otherwise = sublist (x:xs) ys <br><br><br>isEqual :: Eq a => [a] -> [a] -> Bool<br>isEqual [] _ = True<br>isEqual (_:_) [] = False<br>isEqual (x:xs) (y:ys)<br> | x==y = isEqual xs ys<br> | otherwise = False <br></div></div><br>
<hr size=1>Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. <a href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ "> Try it now.</a></body></html>