timeout from System.Timeout doesn't timeout for non-allocating interpreted loops
Summary
The timeout
function from System.Timeout
works great. Except for non-allocating loops in GHCi
Steps to reproduce
In GHCi:
> import System.Timeout
> let f = (($!) f)
> timeout 1 (print (f 2))
Expected behavior
It should return a Nothing
, but instead it just hangs, and doesn't even respond to ^C
, only kill signals.
Environment
- GHC version used: 8.10.4
Optional:
- Operating System: Ubuntu Server
- System Architecture:
Linux mpg 5.4.0-80-generic #90-Ubuntu SMP Fri Jul 9 22:49:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux