Zulip Chat Archive

Stream: lean4

Topic: Type erasure


ohhaimark (Jul 09 2022 at 12:52):

Does lean implement some form of type erasure? If so, does a pattern match that is the identity on erased terms become the identity function?

James Gallicchio (Jul 09 2022 at 13:15):

yes! the compiler throws out almost all type information at runtime -- take a look at the manual for how types get converted to their C representation

James Gallicchio (Jul 09 2022 at 13:18):

and if a pattern match only has one live branch (for instance, if all other branches end in by contradiction), then the match is turned into straight-line control flow


Last updated: Dec 20 2023 at 11:08 UTC