Peter Simons wrote: >This version should do it: > >isSubSeq :: (Eq a) => [a] -> [a] -> Bool >isSubSeq [] _ = True >isSubSeq _ [] = False >isSubSeq (x:xs) (y:ys) > | x == y = isSubSeq xs ys ^^^^^^^^
I think you want to refer to List.isPrefixOf here - your version is a sort of "ordered subset" test. I.e. I get: "abc" `isSubSeq` ".a.b.c." ===> True > | otherwise = isSubSeq (x:xs) ys My version would've been: isSubSeq x = any (isPrefixOf x) . tails But Remi beat me to it (and for that I'll never forgive him! :-). Sam _______________________________________________ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe