3 ms·
Somehow F# uses type erasure. I'm not sure how it works, but I know that it does.
by gagege 12y ago
Somehow F# uses type erasure. I'm not sure how it works, but I know that it does.
- seanmcdirmid 12y agoType erasure on the CLR is exactly as it is on the JVM. Generics are needed for interop with generic libraries (which aren't used that much beyond collections anyways in core libraries). Erasure is necessary when the type system is differently expressive from C#, which I beleive F# is.
- kvb 12y agoTaken at face value I think this is misleading - a typical F# generic type will be represented as a normal .NET generic type at the IL level. However, it is true that some types are erased, like unit-of-measure type arguments or types surfaced by type providers.