如何在Haskell中使线程无限期运行[duplicate]

kmbjn2e3  于 2023-03-13  发布在  其他
关注(0)|答案(1)|浏览(134)

此问题在此处已有答案

How to sleep or delay the thread in Haskell?(1个答案)
Why is it possible to sleep / pause execution in Haskell if it's purely functional?(3个答案)
18小时前关门了。
如何在Haskell中使线程无限期运行?

68de4m5k

68de4m5k1#

下面是一个例子:

main :: IO ()
main = do
  print "Waiting for ever"
  forever $ threadDelay maxBound

相关问题