Guest User

Untitled

a guest
Jul 12th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. count :: String -> (Int, Int)
  2. count s = loop 0 0 0
  3. where
  4. loop i nCons nVow
  5. | i >= length s = (nCons, nVow)
  6. | isCons(s!!i) = loop (i+1) (nCons+1) (nVow)
  7. | isVow(s!!i) = loop (i+1) nCons (nVow+1)
  8. | otherwise = loop (i+1) (nCons) (nVow)
  9.  
  10. : ERROR "countvowels.hs":7 - Syntax error in declaration (unexpected `|')
Add Comment
Please, Sign In to add comment