caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Should you always use GADTs?
@ 2016-03-29 10:08 Malcolm Matalka
  2016-03-29 11:26 ` Ivan Gotovchits
  0 siblings, 1 reply; 2+ messages in thread
From: Malcolm Matalka @ 2016-03-29 10:08 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 225 bytes --]

I've been learning about GADTs this weekend and I'm wondering if there is
any reason to not use them all the time?  Or put another way, should Ocaml
have non generalized variants at all (tossing aside the legacy code thing)?

[-- Attachment #2: Type: text/html, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] Should you always use GADTs?
  2016-03-29 10:08 [Caml-list] Should you always use GADTs? Malcolm Matalka
@ 2016-03-29 11:26 ` Ivan Gotovchits
  0 siblings, 0 replies; 2+ messages in thread
From: Ivan Gotovchits @ 2016-03-29 11:26 UTC (permalink / raw)
  To: Malcolm Matalka; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 713 bytes --]

One particular practical reason:

# type t = Int : int -> t | Float : float -> t [@@deriving bin_io, compare,
sexp];;
Characters 22-23:
  type t = Int : int -> t | Float : float -> t [@@deriving bin_io, compare,
sexp];;
                        ^
bin_write_sum: GADTs are not supported by bin_prot

I'm not sure whether it is a real limitation, or it can be fixed, but so
far there is a difference.




On Tue, Mar 29, 2016 at 6:08 AM, Malcolm Matalka <mmatalka@gmail.com> wrote:

> I've been learning about GADTs this weekend and I'm wondering if there is
> any reason to not use them all the time?  Or put another way, should Ocaml
> have non generalized variants at all (tossing aside the legacy code thing)?
>

[-- Attachment #2: Type: text/html, Size: 1369 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-29 11:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-29 10:08 [Caml-list] Should you always use GADTs? Malcolm Matalka
2016-03-29 11:26 ` Ivan Gotovchits

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).