Using Data.Map and tuple sections:
count = Map.fromListWith (+) . map (, 1)
(Add Map.toList
if you need a list.)
More Related Contents:
- Haskell finding mean of cubes of odd members Any ideas? [closed]
- Histogram in Haskell [closed]
- What is Haskell’s Stream Fusion
- Using return vs. not using return in the list monad
- Cartesian product of infinite lists in Haskell
- Decrementing ranges in Haskell
- Zip with default value instead of dropping values?
- Replace individual list elements in Haskell?
- Using Haskell’s map function to calculate the sum of a list
- Need to partition a list into lists based on breaks in ascending order of elements (Haskell)
- Merging two lists in Haskell
- Haskell Monad – How does Monad on list work?
- Is there a function to flatten a nested list of elements?
- Understanding a recursively defined list (fibs in terms of zipWith)
- Removing duplicates from a list in Haskell without elem
- Removing syntactic sugar: List comprehension in Haskell
- Unsequence Monad function within Haskell
- Grouping a list into lists of n elements in Haskell
- Convert a Scala list to a tuple?
- data.frame rows to a list
- How to create an Object that outputs a List (Not A Table)
- How to convert a matrix to a list of column-vectors in R?
- Getting unique items from a list [duplicate]
- How to cast an object to a list of generic type in F#
- Splitting a list of integers into a list of positive integers and a list of negative integers
- rbind dataframes in a list of lists
- Prevent unlist to drop NULL values
- Pythonic way to convert a list of integers into a string of comma-separated ranges
- Splitting a list of items into two lists of odd and even indexed items
- Implementing “last” in Prolog