
hi I have four functions below: What I want to do is have a way to parse more than one digit or more than one string head in ParseTrue. Any ideas... removeSpace:: String -> StringremoveSpace = dropWhile (`elem` space) where space = [' '] match :: String -> String -> (Bool, String)match word str | ((isPrefixOf) (removeSpace word) (removeSpace str)) = (True,rest) | otherwise = (False,str) where rest = drop (length (removeSpace word)) (removeSpace str) parseDigit :: String -> [(Int, String)]parseDigit (x:xs) | isDigit x = [(read [x],xs)] | otherwise = [] parseTrue :: String -> (Bool, String)parseTrue x = match "True" x Ryan _________________________________________________________________ Celeb spotting – Play CelebMashup and win cool prizes https://www.celebmashup.com
participants (1)
-
Ryan Bloor