[rust-dev] GADT

Cameron Zwarich zwarich at mozilla.com
Wed Jun 4 22:39:12 PDT 2014


There are at least two tricky aspects to adding GADTs in Rust:

1) Rust implements parametric polymorphism via monomorphization (duplicating polymorphic functions for each type), but GADTs are really only useful with polymorphic recursion, which requires a polymorphic function to be applied to a potentially unbounded number of types at runtime.

2) The interaction between GADTs and subtyping (e.g determining the variance of GADT constructors) is nontrivial.

Cameron

> On Jun 4, 2014, at 8:33 AM, Suminda Dharmasena <sirinath at sakrio.com> wrote:
> 
> Hi,
> 
> It is great you have ADT but can you extend it to have GADTs?
> 
> Suminda
> _______________________________________________
> Rust-dev mailing list
> Rust-dev at mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev


More information about the Rust-dev mailing list