我试图从文本文件中删除重复项,我尝试了如下代码;
import Data.List
main = do
let singlewords = []
handle <- readFile "/tmp/foo.txt"
singlewords = words handle
nub singlewords
Run Code Online (Sandbox Code Playgroud)
它当然给出了一个错误,因为我对haskell很新,而且我一直在做一些练习但是我觉得我还有更多的时间来适应它.我非常感谢您的帮助.