module Exercise04 where import Data.List () {-WETT-} xmlLight :: String -> Bool xmlLight s = isValidTag s [[]] -- Testing whether space is not the infix & prefix; -- if ' [String] -> Bool isValidTag [] (b:_) = null b isValidTag _ [] = False isValidTag [a] (b:_) = a `notElem` "<>" && null b isValidTag (c:d:cs) r@(xs:xss) | c == '>' = False | c /= '<' = isValidTag (d:cs) r | d `notElem` "" = all (`notElem` "' tag = takeWhile (/= '>') cs -- '>' is not included tagID = takeWhile (/= ' ') tag rf = dropWhile (/= '>') cs {-TTEW-}