在一个简单的例子中,通过打印将 WHNF 转换为 NF 效果很好
Prelude> let x = 1 + 2 :: Int
Prelude> :sprint x
x = _
Prelude> x
3
Prelude> :sprint x
x = 3
但在某种情况下,类型未声明它不起作用。
Prelude> let x = 1 + 2
Prelude> :sprint x
x = _
Prelude> x
3
Prelude> :sprint x
x = _
您能否详细解释一下为什么转换在最后一种情况下不起作用?