Anagrams: Difference between revisions

Content added Content deleted
(→‎{{header|Haskell}}: make more clear)
Line 31: Line 31:
f <- readFile "./../Puzzels/Rosetta/unixdict.txt"
f <- readFile "./../Puzzels/Rosetta/unixdict.txt"
let words = lines f
let words = lines f
wix = groupBy (groupon fst) . sort $ zipWith ((,).sort) words words
wix = groupBy (groupon fst) . sort $ zip (map sort words) words
mxl = foldl' ((.length).max) 0 wix
mxl = maximum $ map length wix
print . map (map snd) . filter ((==mxl).length) $ wix
print . map (map snd) . filter ((==mxl).length) $ wix