Skip to content

Commit c10aa94

Browse files
committed
indv vowel counting
1 parent 72259d2 commit c10aa94

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Text/count_vowels.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import Data.Map
2+
13
main = do
24
string <- getLine
3-
let vowels = only_vowels string
4-
putStrLn $ show (length (only_vowels string))
5+
putStrLn $ show (toList $ fromListWith (+) [ (c,1) | c <- (only_vowels string) ] )
56

67
vowels = "aeiou"
78
only_vowels x = [ c | c <- x, c `elem` vowels ]

0 commit comments

Comments
 (0)