I want make a function which when given a string eg "ab" and "cdabd" when it will be used on these two strings it will output "cd"
I have this up to now
takeUntil :: String -> String -> String
takeUntil [] [] = []
takeUntil xs [] = []
takeUntil [] ys = []
takeUntil xs ys = if contains xs ys then -- ???? I get stuck here.
the contains function is one in which I had defined previously(this whole function should be case insensitive) contains function:
contains :: String -> String -> Bool
contains _ [] = True
contains [] _ = False
contains xs ys = isPrefixOf (map toLower ys) (map toLower xs) || contains (tail(map toLower xs) (map toLower ys)