Can someone explain how this feature works and/or how much impact it has on Haskell's feasibility as a performant, i.e., game engine or real-time application language?
Unfortunately, I doubt that nondeterministic garbage collection will ever mesh well with high-performance gaming and especially ever with real-time problems. For ordinary systems programming, however, I think it's frequently possible for high-resident-memory applications to build a walled garden for their e.g. in-memory caches or large binary assets.
Does this mean GHC does not erase types at runtime? Or perhaps what do they mean by "reflection" here; I only know it in the context of Java, where it more or less felt like an anti-pattern.
Paper: https://www.microsoft.com/en-us/research/wp-content/uploads/...
Package: https://downloads.haskell.org/~ghc/latest/docs/html/librarie...
Also there's this: "This paper is literate Haskell and our examples compile under GHC 8.0." A 26 page, typeset paper is certainly the longest example of a literate Haskell program I've come across! Wow.
The resolution of this apparently contradiction is in the type class mechanism. Type classes ("classes" for short) can be seen as functions from type to value that are automatically resolved by the compiler as much as possible. (There are many other semantically-valid interpretations, like predicates on types, proof obligations, etc.)
Most classes are library-level constructs, defined and implemented entirely with libraries, but there are a few special ones that are completely managed by the compiler. One of the few compiler-managed classes is named Typeable, which allows you to request a runtime representation of the type of an expression. It then provides tools for testing if the runtime representations correspond to the same type, and proving two types are the same at runtime. This is useful in the case where you can prove something is type safe, but the type system doesn't provide you with the tools to express it.
Common cases where you end up doing this in Haskell are creating heterogeneous stores with type-safe keys, or mechanisms like GHC's exception system.
Anyway, the new part here is the addition of a variant of Typeable. It gives more information at compile time so that it can enable a few more tricks within the type system and the implementation doesn't depend on as many unsafe internal primitives.
A/V fans will enjoy this talk by Ed, whose energy and enthusiasm for the extremely dry world of language module design knows no bounds. Also hand-illustrated! https://www.youtube.com/watch?v=Rda6SNhznRs