caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Peter Zotov <whitequark@whitequark.org>
To: Yotam Barnoy <yotambarnoy@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] [ANN] ppx_deriving 0.1
Date: Thu, 24 Jul 2014 00:19:53 +0400	[thread overview]
Message-ID: <e80703f7323f3e72b345836b5e48927e@whitequark.org> (raw)
In-Reply-To: <CAN6ygOm=oKhJzDP6RGpxOye-XXypm5tEWdjwvwUr6pVqrEyxGQ@mail.gmail.com>

On 2014-07-23 18:36, Yotam Barnoy wrote:
> Very nice.
> 
> I've never used any of the deriving extensions before, but I have an
> aesthetic suggestions.

I humbly suggest trying to use it before proposing aesthetic changes.

> Would it perhaps make sense to generate a
> module per derived type? For example a type t would generate a module
> T_ (the underscore or any other suffix would reduce mixups with
> pre-existing modules). You could then use code such as
> 
> 'if T_.(a = b && b = c) ...'
> 
> or  'T_.show x ...'
> 
> which allows you to keep the infix notation for = which is important
> IMO.
> 
> You could even generate T_ as having internal Eq, Ord, and Show
> modules (as requested by the user), which would be included in the T_
> module. This would allow you to easily pass them as first class
> modules to functions accepting Eq, Ord or Show signatures.

I believe this is best left to the upcoming implicits, which will
hopefully be merged soon.

I have based the current design on existing patterns across OCaml
ecosystem; I don't want to change the way people structure their
modules, I want to reduce the amount of boilerplate to write.

-- 
Peter Zotov
sip:whitequark@sipnet.ru

  reply	other threads:[~2014-07-23 20:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-23  9:55 Peter Zotov
2014-07-23 14:36 ` Yotam Barnoy
2014-07-23 20:19   ` Peter Zotov [this message]
2014-07-23 20:37     ` Yotam Barnoy
2014-07-28 12:26       ` Peter Zotov

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=e80703f7323f3e72b345836b5e48927e@whitequark.org \
    --to=whitequark@whitequark.org \
    --cc=caml-list@inria.fr \
    --cc=yotambarnoy@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).