Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- count :: String -> (Int, Int)
- count s = loop 0 0 0
- where
- loop i nCons nVow
- | i >= length s = (nCons, nVow)
- | isCons(s!!i) = loop (i+1) (nCons+1) (nVow)
- | isVow(s!!i) = loop (i+1) nCons (nVow+1)
- | otherwise = loop (i+1) (nCons) (nVow)
- : ERROR "countvowels.hs":7 - Syntax error in declaration (unexpected `|')
Add Comment
Please, Sign In to add comment