TL;DR
An encoding for existential types in Haskell allows them to be used directly in types without wrapping, enhancing type safety and flexibility. This approach leverages linear functions and introduces a method for preserving type instantiation in function results.
✦ Why It Matters
Explore this encoding to simplify existential type usage in your Haskell projects today.
Key Takeaways
How It Works
The encoding allows existential types to be passed as proof tokens, enabling their use without wrapping. By introducing a proxy type, Fresh, the existential quantification is managed externally, allowing functions to choose their type instantiation safely.
This is achieved through linear types, which enforce strict usage patterns, ensuring that the existential types are handled correctly.
Related