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 <[email protected]> wrote:
> 
> Hi,
> 
> It is great you have ADT but can you extend it to have GADTs?
> 
> Suminda
> _______________________________________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to