ryanbloor at hotmail.com
Sat Dec 8 18:59:29 EST 2007
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
Celeb spotting – Play CelebMashup and win cool prizes
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe