Sha256: 70583176feeee4708a8eab635715c38083422979054e5cb19a5b080088af19d1

Contents?: true

Size: 360 Bytes

Versions: 5

Compression:

Stored size: 360 Bytes

Contents

module WordCount (wordCount) where

import Control.Arrow   ((&&&))
import Data.Char       (toLower, isAlphaNum)
import Data.List       (group, sort)
import Data.List.Split (wordsBy)

wordCount :: String -> [(String, Int)]
wordCount = map (head &&& length)
          . group
          . sort
          . map (map toLower)
          . wordsBy (not . isAlphaNum)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
trackler-2.0.0.3 tracks/haskell/exercises/word-count/examples/success-simple/src/WordCount.hs
trackler-2.0.0.2 tracks/haskell/exercises/word-count/examples/success-simple/WordCount.hs
trackler-2.0.0.1 tracks/haskell/exercises/word-count/examples/success-simple/WordCount.hs
trackler-2.0.0.0 tracks/haskell/exercises/word-count/examples/success-simple/WordCount.hs
trackler-1.0.4.1 tracks/haskell/exercises/word-count/examples/success-simple/WordCount.hs