From f191fce702c4bfe251067807a8ad1aa1de7550b1 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Tue, 23 Feb 2021 15:14:49 -0500 Subject: base: Add reference to #19413 to Note [unsafePerformIO and strictness] --- libraries/base/GHC/IO/Unsafe.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libraries/base/GHC/IO') diff --git a/libraries/base/GHC/IO/Unsafe.hs b/libraries/base/GHC/IO/Unsafe.hs index 9dfaaa1e2f..5284dcf887 100644 --- a/libraries/base/GHC/IO/Unsafe.hs +++ b/libraries/base/GHC/IO/Unsafe.hs @@ -40,7 +40,7 @@ Consider this sub-expression (from tests/lib/should_run/memo002) It's super-important that the `let r = f x` is lazy. If the demand analyser sees that `r` is sure to be demanded, it'll use call-by-value for (f x), that will try to lock the already-locked table => deadlock. -See #19181. +See #19181 and #19413. Now `r` doesn't look strict, because it's wrapped in a `return`. But if we were to define unsafePerformIO like this -- cgit v1.2.1