From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 DEB087EE99 for ; Sun, 19 Jan 2014 07:09:08 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of oleg@okmij.org) identity=pra; client-ip=66.39.3.115; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="oleg@okmij.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of oleg@okmij.org designates 66.39.3.115 as permitted sender) identity=mailfrom; client-ip=66.39.3.115; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="oleg@okmij.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@www1.g3.pair.com) identity=helo; client-ip=66.39.3.115; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="postmaster@www1.g3.pair.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvERAHxr21JCJwNzY2dsb2JhbABZg0OIMLNcgRwDGAcOCDyCJQEBAQMBeQUWGBxpFIgCCA3EFxeNBIF7BxaEIgSYIQGBMpQTPA X-IPAS-Result: AvERAHxr21JCJwNzY2dsb2JhbABZg0OIMLNcgRwDGAcOCDyCJQEBAQMBeQUWGBxpFIgCCA3EFxeNBIF7BxaEIgSYIQGBMpQTPA X-IronPort-AV: E=Sophos;i="4.95,683,1384297200"; d="scan'208";a="53869487" Received: from www1.g3.pair.com ([66.39.3.115]) by mail2-smtp-roc.national.inria.fr with SMTP; 19 Jan 2014 07:09:07 +0100 Received: (qmail 69436 invoked by uid 9370); 19 Jan 2014 06:09:06 -0000 Date: 19 Jan 2014 06:09:06 -0000 Message-ID: <20140119060906.69435.qmail@www1.g3.pair.com> From: oleg@okmij.org To: gabriel.scherer@gmail.com CC: yallop@gmail.com, jon@ffconsultancy.com, garrigue@math.nagoya-u.ac.jp, caml-list@inria.fr In-reply-to: Subject: Re: [Caml-list] ocaml considered dangerous > Jacques Garrigue wrote: > By the way, there is now an implementation of Printf that avoids > most of the Obj.magic by using GADTs. It should be merged soon. Perhaps it may be worth mentioning a (quite old actually) paper http://okmij.org/ftp/typed-formatting/index.html#derivation that attempts to _derive_ various typed scanf and printf implementation, including a couple of new ones. All the code is in OCaml. Perhaps also relevant is http://okmij.org/ftp/typed-formatting/index.html#C-like which uses Template Haskell to convert a C-like format string into the proper combinator format. The conversion is syntax-directed rather than type directed (that is, a simple preprocessor, like ppx). In the above developments, the types seem to have fewer type parameters than what I've seen presented at the OCaml workshop. I am still not clear about the source of that difference.