Nearest Neighbour classification algorithm
One helpful function is Data.Ord.comparing:

comparing :: (Ord a) =&gt; (b -&gt; a) -&gt; b -&gt; b -&gt; Ordering
comparing p x y = compare (p x) (p y)


With this and using function composition you can write:

getMostCommon :: (Eq a) =&gt; [a] -&gt; a
getMostCommon = head . maximumBy (comparing length) . groupBy (==)


Similar changes apply to several places.  Another small simplification could be changing (\x -&gt; (fst x) == (snd x)) to uncurry (==).