caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Generalized algebraic datatypes
@ 2008-04-28  5:35 Jacques Le Normand
  2008-04-28  6:50 ` [Caml-list] " Gabriel Kerneis
  0 siblings, 1 reply; 11+ messages in thread
From: Jacques Le Normand @ 2008-04-28  5:35 UTC (permalink / raw)
  To: caml-list

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

Dear caml-list,
I'm writing a toy compiler that compiles into ocaml and my toy compiler
supports Generalized Algebraic Datatypes, so I need to compile into a
language which also supports them.
Does ocaml support Generalized Algebraic datatypes? If not, are there any
caml based compilers that support it?
cheers
--Jacques

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

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Generalized Algebraic Datatypes
@ 2010-10-25  8:39 Jacques Le Normand
  2010-10-25  9:44 ` [Caml-list] " bluestorm
  2010-10-27 21:07 ` Florian Hars
  0 siblings, 2 replies; 11+ messages in thread
From: Jacques Le Normand @ 2010-10-25  8:39 UTC (permalink / raw)
  To: caml-list caml-list

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

Dear Caml list,

I am pleased to announce an experimental branch of the O'Caml compiler:
O'Caml extended with Generalized Algebraic Datatypes. You can find more
information on this webpage:

https://sites.google.com/site/ocamlgadt/


And you can grab the latest release here:

svn checkout https://yquem.inria.fr/caml/svn/ocaml/branches/gadts


Any feedback would be very much appreciated.

Sincerely,

Jacques Le Normand

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

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [Caml-list] Generalized Algebraic Datatypes
@ 2010-10-25 10:17 Dario Teixeira
  0 siblings, 0 replies; 11+ messages in thread
From: Dario Teixeira @ 2010-10-25 10:17 UTC (permalink / raw)
  To: caml-list caml-list, Jacques Le Normand

Hi,

> I am pleased to announce an experimental branch of the O'Caml compiler:
> O'Caml extended with Generalized Algebraic Datatypes. You can find more
> information on this webpage:

More in depth feedback will come after proper digestion; for now let me
just say these are great news!  And I'm sure there are other Ocaml users
out there who will be glad to finally get rid of some of the Obj.magic
blemishes in their code...

Best regards,
Dario Teixeira






^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [Caml-list] Generalized Algebraic Datatypes
@ 2010-10-29 14:32 Dario Teixeira
  2010-10-29 15:03 ` Jacques Le Normand
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Dario Teixeira @ 2010-10-29 14:32 UTC (permalink / raw)
  To: caml-list, Jacques Le Normand

Hi,

> I am pleased to announce an experimental branch of the O'Caml compiler:
> O'Caml extended with Generalized Algebraic Datatypes. You can find more
> information on this webpage:

I have a couple of questions regarding the syntax you've chosen for GADT
declaration.  For reference, let's consider the first example you've provided:

type _ t =
  | IntLit : int -> int t
  | BoolLit : bool -> bool t
  | Pair : 'a t * 'b t -> ('a * 'b) t
  | App : ('a -> 'b) t * 'a t -> 'b t
  | Abs : ('a -> 'b) -> ('a -> 'b) t 


There's something "Haskellish" about this syntax, in the sense that type
constructors are portrayed as being like functions.  While this does make
sense in Haskell, in Ocaml it feels a bit out of place, because you cannot,
for example, partially apply a type constructor.

Also, note that in all the variant declarations the final token is 't'.  
Are there any circumstances at all where a GADT constructor will not end
by referencing the type being defined?  If there are not, then this syntax
imposes some syntactic salt into the GADT declaration.

I know this is not the sole syntax that was considered for GADTs in Ocaml.
Xavier Leroy's presentation in CUG 2008 shows a different one, which even
though slightly more verbose, does have the advantage of being more "Camlish".
Is there any shortcoming to the 2008 syntax that resulted in it being dropped
in favour of this new one?

Best regards,
Dario Teixeira






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

end of thread, other threads:[~2010-10-29 16:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-28  5:35 Generalized algebraic datatypes Jacques Le Normand
2008-04-28  6:50 ` [Caml-list] " Gabriel Kerneis
2010-10-25  8:39 Generalized Algebraic Datatypes Jacques Le Normand
2010-10-25  9:44 ` [Caml-list] " bluestorm
2010-10-26  5:30   ` Jacques Le Normand
2010-10-27 21:07 ` Florian Hars
2010-10-25 10:17 Dario Teixeira
2010-10-29 14:32 Dario Teixeira
2010-10-29 15:03 ` Jacques Le Normand
2010-10-29 15:53 ` Jacques Le Normand
     [not found] ` <129751088.61814.1288367649864.JavaMail.root@zmbs4.inria.fr>
2010-10-29 16:02   ` Xavier Leroy
2010-10-29 16:42     ` Dario Teixeira

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).