//edit 5 when the i use only these 2 lines
index :: [String] -> [String] -> Bool
index a b = and [x `elem` a |x <- b]
it works fine!!!!
eg:
index ["asd","asdd","dew"] ["asdd","asdad"]
False
But when i use the entire code mentioned below
empty [] = True
empty _ = False
index a b = do
if empty a
then do putStrLn "a is empty"
else return ()
if empty b
then do putStrLn "b is empty"
else return ()
where
index :: [String] -> [String] -> Bool
index a b = and [x `elem` a |x <- b]
theres no output!! and thats the issue i got!!
//edit 6
index a b = do index'
if empty a
then do putStrLn "a is empty"
else return ()
if empty b
then do putStrLn "b is empty"
else return ()
where
index' :: [String] -> [String] -> Bool
index' a b = and [x `elem` a |x <- b]
thanks