buildHashes = map (crc32 . encode . concat . take 2 . sortSent . splitSent) . splitParmain = readFile "l.txt" >>= mapM_ print . textHashsplitPar st = filter (not . null) $ split st "\n"sortSent = sortBy (comparing sls) where sls a = (- length a, a)-- в последней `base` лучше where sls a = (Down $ length a, a)Посмотрите, подойдёт ли вам библиотека http://hackage.haskell.org/package/split , прогоните через HLint и опубликуйте на http://codereview.stackexchange.com/ с тегом [haskell]Edited at 2012-11-08 11:43 am (UTC) map (hash . concat . longestSent 2) (splitPar txt) where hash = crc32 . encode longestSent n = take n . sortSent . splitSent Так эстетичнее? |