From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id D05627FA56 for ; Wed, 23 Jul 2014 22:19:59 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of whitequark@whitequark.org) identity=pra; client-ip=176.58.103.125; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="whitequark@whitequark.org"; x-sender="whitequark@whitequark.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of whitequark@whitequark.org designates 176.58.103.125 as permitted sender) identity=mailfrom; client-ip=176.58.103.125; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="whitequark@whitequark.org"; x-sender="whitequark@whitequark.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail.whitequark.org) identity=helo; client-ip=176.58.103.125; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="whitequark@whitequark.org"; x-sender="postmaster@mail.whitequark.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArMuAMMY0FOwOmd9/2dsb2JhbABZhDeCJ60VAQEBAQEBBoE6ni0BgSF2hAMBAQQBOAI/BQsEBxguLCsGEwiIMgzAFxeFe4NlhF2BDgeERgEEimGcOIhUg004Lw X-IPAS-Result: ArMuAMMY0FOwOmd9/2dsb2JhbABZhDeCJ60VAQEBAQEBBoE6ni0BgSF2hAMBAQQBOAI/BQsEBxguLCsGEwiIMgzAFxeFe4NlhF2BDgeERgEEimGcOIhUg004Lw X-IronPort-AV: E=Sophos;i="5.01,719,1400018400"; d="scan'208";a="86702689" Received: from fehu.whitequark.org (HELO mail.whitequark.org) ([176.58.103.125]) by mail2-smtp-roc.national.inria.fr with ESMTP; 23 Jul 2014 22:19:54 +0200 Received: by mail.whitequark.org (Postfix, from userid 33) id 35CE14D737; Wed, 23 Jul 2014 20:19:53 +0000 (UTC) To: Yotam Barnoy X-PHP-Originating-Script: 1000:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 24 Jul 2014 00:19:53 +0400 From: Peter Zotov Cc: caml-list@inria.fr In-Reply-To: References: <0618b5ce9c054e91507c03eae7e7de0c@whitequark.org> Message-ID: X-Sender: whitequark@whitequark.org User-Agent: Roundcube Webmail/1.0.1 Subject: Re: [Caml-list] [ANN] ppx_deriving 0.1 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