Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: whitequark <whitequark@whitequark.org>
To: Kakadu <kakadu.hafanana@gmail.com>
Cc: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] [ANN] visitors
Date: Thu, 16 Mar 2017 15:33:57 +0000	[thread overview]
Message-ID: <fd4f9615298f694ad7d7d7f8f20d301b@whitequark.org> (raw)
In-Reply-To: <CAGmVoG14OcOcoWN=fEg71XOJt0G3ZOO_OjHmKUTkg-Rf3CE6jQ@mail.gmail.com>

On 2017-03-16 11:12, Kakadu wrote:
> Can we have something like
> 
> type ('a,'b) glist = Nil | Cons ...
> type 'a list = ('a, 'a list) glist [%import crazy hack to know
> constructors of glist here]
> ?

I actually planned this feature, but scrapped it because I did not want
to implement module scoping. A PR would be warmly welcome.

> 
> Happy hacking,
> Kakadu
> 
> On Thu, Feb 2, 2017 at 3:46 AM, Emilio Jesús Gallego Arias <e@x80.org> 
> wrote:
>> whitequark <whitequark@whitequark.org> writes:
>> 
>>> Unfortunately Emilio has the shortest implementation that's possible
>>> right now.
>> 
>>> I think this would be a fairly straightforward addition to 
>>> ppx_import.
>> 
>> In the lines of François suggestion, it would be great if ppx_import
>> could some kind of "batch" import for modules. Imagine you want to add
>> show to a whole module, you could do:
>> 
>> [%import: M
>>   [@attach all [[@deriving show]]]]
>> 
>> or
>> 
>> module M = [%import M ....]
>> 
>> Another option is to teach deriving about modules:
>> 
>> module M = M
>> [@@deriving sexp]
>> 
>> but I am not sure what would be the best way to avoid all the
>> boilerplate I currently have [would had submitted an issue otherwise]
>> 
>> Best,
>> Emilio
>> 
>> --
>> Caml-list mailing list.  Subscription management and archives:
>> https://sympa.inria.fr/sympa/arc/caml-list
>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>> Bug reports: http://caml.inria.fr/bin/caml-bugs

-- 
whitequark

      reply	other threads:[~2017-03-16 15:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-27 17:56 François Pottier
     [not found] ` <fc83f6ab-90a1-8ac1-7585-a15fb7fe89bd@zoho.com>
2017-01-30 16:04   ` François Pottier
2017-01-30 16:18     ` François Pottier
2017-01-31  9:30     ` whitequark
2017-01-31 10:26       ` François Pottier
2017-01-31 21:02         ` whitequark
2017-01-31 12:46       ` François Pottier
2017-02-01 15:50         ` Emilio Jesús Gallego Arias
2017-02-01 16:48           ` François Pottier
2017-02-01 23:49             ` whitequark
2017-02-02  0:46               ` Emilio Jesús Gallego Arias
2017-03-16 11:12                 ` Kakadu
2017-03-16 15:33                   ` whitequark [this message]

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=fd4f9615298f694ad7d7d7f8f20d301b@whitequark.org \
    --to=whitequark@whitequark.org \
    --cc=caml-list@inria.fr \
    --cc=kakadu.hafanana@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