1

我是 Haskell 的新手,我遇到了编译器错误的问题。运行以下代码时,我不断收到以下错误:src\Main.hs:26:22 Not in scope: 'threadDelay'。我认为它一定与间距或制表符有关,因为 Haskell 对此非常挑剔,但我似乎无法找到我的问题所在。

eachMinute :: Bool -> Int -> [a] -> [a] -> String
eachMinute keepGoing num resevoir bin1 
    | keepGoing == False =  ""                             
    | otherwise = do answer resevoir bin1
                     threadDelay (1000 * 1000)
                     eachMinute keepGoing 0 resevoir bin1 
4

0 回答 0