2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
14
Task/Anagrams/Ela/anagrams.ela
Normal file
14
Task/Anagrams/Ela/anagrams.ela
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
open monad io list string
|
||||
|
||||
groupon f x y = f x == f y
|
||||
|
||||
lines = split "\n" << replace "\n\n" "\n" << replace "\r" "\n"
|
||||
|
||||
main = do
|
||||
fh <- readFile "c:\\test\\unixdict.txt" OpenMode
|
||||
f <- readLines fh
|
||||
closeFile fh
|
||||
let words = lines f
|
||||
let wix = groupBy (groupon fst) << sort $ zip (map sort words) words
|
||||
let mxl = maximum $ map length wix
|
||||
mapM_ (putLn << map snd) << filter ((==mxl) << length) $ wix
|
||||
Loading…
Add table
Add a link
Reference in a new issue