News for hackers. Stuff that matters.
Re:Generalized Algebraic Data Types: A Primer by anuragsoni on Tuesday June 18, 2019 @10:46PM (#20220410)
FWIW OCaml (the linked example is using reason, a different syntax for OCaml) doesn't need a syntax extension for GADTs.

On a similar note i find the OCaml syntax easier to read than Reason's. (There is an option to toggle between the two in the linked website)

The example from your post in OCaml:

  type 'a restricted_maybe =
    | JustInt : int -> int restricted_maybe
    | JustString : string -> string restricted_maybe
    | Nothing : 'a restricted_maybe
Re:Generalized Algebraic Data Types: A Primer by acchow on Wednesday June 19, 2019 @04:10PM (#20226861)
That’s essentially the same but with the type parameter appearing before the type name.