Sha256: 42b1cf1fb76381496caf4fcfc4b82504f107523cc2c171a41ae236e66b296ec6
Contents?: true
Size: 299 Bytes
Versions: 9
Compression:
Stored size: 299 Bytes
Contents
module WordCount (wordCount) where import Data.Char (toLower, isAlphaNum) import Data.Map.Strict (Map, fromListWith) import Data.List.Split (wordsBy) wordCount :: String -> Map String Int wordCount = fromListWith (+) . map pair . wordsBy (not . isAlphaNum) where pair word = (map toLower word, 1)
Version data entries
9 entries across 9 versions & 1 rubygems