News for hackers. Stuff that matters.
Re:The struggle with Rust by codygman on Tuesday January 24, 2017 @02:26PM (#13474616)
After quickly scanning https://realworldocaml.org/v1/en/html/variants.html, isn't the same thing accomplished by GADTs?
Re:The struggle with Rust by rbehrends on Tuesday January 24, 2017 @02:39PM (#13474727)
The point of polymorphic variants is that the entire type doesn't have to be fully defined in one place; you can have partial definitions in a module and those definitions can even overlap. You can have (say) [ `Int of int | `String of string ] in one module and [ `String of string | `Char of char ] in another, and the typechecker will handle intersections and unions of these types.