[erlang-questions] GADTs / polymorphic data types?

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Mon Feb 25 11:04:09 CET 2013


On Feb 13, 2013, at 2:40 AM, Erik Søe Sørensen <eriksoe@REDACTED> wrote:

> 
> The form GADTs usually take is tuples-with-fixed-atoms-as-first-element (or just atoms for variants that don't contain data).
> Haskell GADTs like
>     data Either a b = Left a | Right b
>     data Maybe a = Some a | None
> 

For the record, these are only ADTs, not GADTs. A GADT relaxes a type binder (variable) so it can specialize in certain subtrees of a data type.

But this is not needed in Erlang as it is a "mutually consenting adult" language. You will need to handle it yourself.

Jesper Louis Andersen
  Erlang Solutions Ltd., Copenhagen




More information about the erlang-questions mailing list