为什么在`accursedUnutterablePerformIO`中没有`seq`?

时间:2016-02-18 06:14:31

标签: haskell ghc unsafe-perform-io

为什么accursedUnutterablePerformIO(又名inlinePerformIO)已实施

accursedUnutterablePerformIO :: IO a -> a
accursedUnutterablePerformIO (IO a) = case a realWorld# of (# _, r #) -> r

而不是

accursedUnutterablePerformIO :: IO a -> a
accursedUnutterablePerformIO (IO a) = case a realWorld# of (# s, r #) -> s `seq` r

1 个答案:

答案 0 :(得分:6)

简单地说,realWorld# doesn't exist runtime,因此我们无法对其进行任何计算,因此seq也无法做任何事情。