Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created Feb 18, 2015
Embed
What would you like to do?
import Data.List
numUniques :: (Eq a) => [a] -> Int
-- ポイントフリースタイルが登場しています
numUniques = length . nub
numUniques' x = (length . nub) x
main = do
print $ numUniques [3,3,3,4,5] -- 3
print $ numUniques' [3,3,3,4,5] -- 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment