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 F2B8D7F9B9 for ; Tue, 1 Jul 2014 12:00:03 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gabriel@kerneis.info) identity=pra; client-ip=176.31.113.173; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel@kerneis.info"; x-sender="gabriel@kerneis.info"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of gabriel@kerneis.info designates 176.31.113.173 as permitted sender) identity=mailfrom; client-ip=176.31.113.173; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel@kerneis.info"; x-sender="gabriel@kerneis.info"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of postmaster@wanbli.kerneis.info designates 176.31.113.173 as permitted sender) identity=helo; client-ip=176.31.113.173; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel@kerneis.info"; x-sender="postmaster@wanbli.kerneis.info"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgEFADeGslOwH3Gt/2dsb2JhbABagmkkUsdOFnWERAYBATg7NAV3iCgDAapvhXkBBZceBo8kgxeBFpBGih+GeY0HgUKCAQ X-IPAS-Result: AgEFADeGslOwH3Gt/2dsb2JhbABagmkkUsdOFnWERAYBATg7NAV3iCgDAapvhXkBBZceBo8kgxeBFpBGih+GeY0HgUKCAQ X-IronPort-AV: E=Sophos;i="5.01,581,1400018400"; d="scan'208";a="83095955" Received: from wanbli.kerneis.info ([176.31.113.173]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 01 Jul 2014 12:00:03 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kerneis.info; s=wanbli-rsa1; h=Content-Type:MIME-Version:Message-ID:Subject:To:From:Date; bh=Y2mX4AkMR/WSBVk67cYX7sxPau9WNRkwQfSW2EIiL08=; b=WVW4zZhf0e7S+S8FtWHw5A1DGM5EDLd9XWO2BcWY3ku5wbuYpzR4K5UjhEhKgqjnLzjIRgNXRxS6SnCp5/5oa98uVGiXofnD1VgW7FNtyposuqzF717vsm3kxtqQyI8BFvBz+HWMhw1JwmEMwX3qRlNjO/J5Kk8V7Ct1S9LdoI4=; Received: from [2001:630:212:220:21f:16ff:fe29:d9b6] (helo=localhost) by wanbli.kerneis.info with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1X1ur3-0006JD-N6 for caml-list@inria.fr; Tue, 01 Jul 2014 10:00:01 +0000 Date: Tue, 1 Jul 2014 10:59:55 +0100 From: Gabriel Kerneis To: caml-list@inria.fr Message-ID: <20140701095955.GE4120@kerneis.info> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 2001:630:212:220:21f:16ff:fe29:d9b6 X-SA-Exim-Mail-From: gabriel@kerneis.info X-SA-Exim-Scanned: No (on wanbli.kerneis.info); SAEximRunCond expanded to false Subject: [Caml-list] Extending Format strings Dear all, in CIL , the module Pretty provides a Format-like interface with a few extensions compared to usual format strings. Implementation-wise, it uses string_of_format and re-implements most of the logic of the pre-4.02 Format module, with Obj.magic all over the place. I wondered if anyone has done something similar in their own project (extending Format in one way or another), and if the new GADT-based approach could provide a cleaner solution? One thing I quite like with the current code, despite its uglyness, is its concision. I am right in assuming that switching to GADTs would require a lot more boilerplate? Many thanks for any example you could provide. With best regards, -- Gabriel