小编use*_*760的帖子

删除haskell中文本文件中的重复项

我试图从文本文件中删除重复项,我尝试了如下代码;

import Data.List
main = do  
    let singlewords = []
    handle <- readFile "/tmp/foo.txt" 
    singlewords = words handle
    nub singlewords
Run Code Online (Sandbox Code Playgroud)

它当然给出了一个错误,因为我对haskell很新,而且我一直在做一些练习但是我觉得我还有更多的时间来适应它.我非常感谢您的帮助.

string io haskell

3
推荐指数
1
解决办法
223
查看次数

标签 统计

haskell ×1

io ×1

string ×1