Why no `seq` in `accursedUnutterablePerformIO`?

391 views Asked by At

Why is accursedUnutterablePerformIO (aka inlinePerformIO) implemented

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

and not

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

?

1

There are 1 answers

6
András Kovács On BEST ANSWER

Simply put, realWorld# doesn't exist runtime, therefore we can't do any computation on it, thus seq doesn't do anything either.