caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: Lukasz Stafiniak <lukstafi@gmail.com>
Cc: "Milan Stanojević" <milanst@gmail.com>, Caml <caml-list@inria.fr>
Subject: Re: [Caml-list] GADT definition
Date: Fri, 20 Dec 2013 00:10:44 +0100	[thread overview]
Message-ID: <CAPFanBH1nNsaqDQZDkBEY_9=iEM2i=n0wUeFYFBfp2VC8hzsaA@mail.gmail.com> (raw)
In-Reply-To: <CAJMfKEXQFwGX=L0tbXuUdhqV00j83Ye80+SiBhJZ+TWAZFbcQQ@mail.gmail.com>

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

type z
type _ s

Don't use this kind of abstract type definition. Use instead (and export)
concrete definitions (even if you don't use their constructors for anything)

type 'a s = S of 'a
(or just type 'a s = S)

They have "better" injectivity properties. We've mentioned in on the
mailing-list a couple of time, and it's also the "easy take-away lesson"
from Jacques Garrigue talk at the OCaml workshop in September.


On Thu, Dec 19, 2013 at 11:35 PM, Lukasz Stafiniak <lukstafi@gmail.com>wrote:

> On Thu, Dec 19, 2013 at 11:27 PM, Milan Stanojević <milanst@gmail.com>wrote:
>
>> What version of ocaml are you using? It works for me on 4.00.1
>>
>>  OCaml 4.01.0 from OPAM.
>
>  On Thu, Dec 19, 2013 at 5:21 PM, Lukasz Stafiniak <lukstafi@gmail.com>
>> wrote:
>> > On Thu, Dec 19, 2013 at 11:20 PM, Lukasz Stafiniak <lukstafi@gmail.com>
>> > wrote:
>> >>
>> >> Sorry! I've spotted it reading the email. (I should read before
>> sending.)
>> >>
>> > No, that's not it. My question is still open.
>>
>
>

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

  reply	other threads:[~2013-12-19 23:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-19 22:17 Lukasz Stafiniak
2013-12-19 22:20 ` Lukasz Stafiniak
2013-12-19 22:21   ` Lukasz Stafiniak
2013-12-19 22:27     ` Milan Stanojević
2013-12-19 22:35       ` Lukasz Stafiniak
2013-12-19 23:10         ` Gabriel Scherer [this message]
2013-12-19 23:47           ` Jacques Le Normand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPFanBH1nNsaqDQZDkBEY_9=iEM2i=n0wUeFYFBfp2VC8hzsaA@mail.gmail.com' \
    --to=gabriel.scherer@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=lukstafi@gmail.com \
    --cc=milanst@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).