Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 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