My function takes 2 strings and determines if the first string is a substring of the second input string. For instance:
isSubb "abc" "abcmhk" -- True
isSubb "abc" "uyabcmhk" -- True
isSubb "abc" "okaibcmhk" -- False
isSubb "abc" "amnabkaaabcmhk" -- gives True
So far I have:
isSubb :: [Char] -> [Char] -> Bool
isSubb sub str = auxx sub sub str
auxx :: [Char] -> [Char] -> [Char] -> Bool
auxx safe (s:ub) (st:r)
| s:ub == [] = True
| st:r == [] = False
| s == st = auxx safe ub r
| otherwise = auxx safe safe r
But its giving me a non-exhaustive error on the auxx function.
Any help is greatly appreciated! Thank you!