Zulip Chat Archive

Stream: lean4

Topic: What does Void do?


Luke West (Dec 07 2025 at 00:16):

What does the Void type do in lean4/src/Init/System/ST.lean? How should I think about it? I've been looking through those files to get a better idea of how the IO monad actually works, but Void is opaque and doesn't have any documentation that I can see.

Henrik Böving (Dec 07 2025 at 00:34):

It's a piece of data that gets erased in the last third of the compiler pipeline. This allows ST and BaseIO to have allocation free return values because they don't need to return a pair of RealWorld and the data anymore but just the data


Last updated: Dec 20 2025 at 21:32 UTC