Count how many vowels and consonants occur in a string: Difference between revisions
Count how many vowels and consonants occur in a string (view source)
Revision as of 14:18, 12 September 2021
, 2 years ago→{{header|Haskell}}: Tidied
m (→{{header|Haskell}}: Tidied) |
|||
Line 249:
import Data.Bifunctor (bimap)
import Data.Char (isAlpha)
import Data.List (intercalate, partition)
import qualified Data.Map.Strict as M
Line 271:
isVowel :: Char -> Bool
isVowel
--------------------------- TEST -------------------------
Line 291:
<> fmap
('\t' :)
(
[ ("vowels",
]
<> (('\t' :) . show <$> v)▼
<> [ "",▼
show cTotal <> " characters drawn from "▼
<> show (length c)▼
]▼
)
------------------------ FORMATTING ----------------------
report :: (String, Int, [(Char, Int)]) -> [String]
report (label, total, xs) =
[ show total
)
]
<> [""]
------------------------- GENERIC ------------------------
|