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 E44037F869 for ; Mon, 10 Mar 2014 01:47:28 +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: Au6sAAILHVNCJwNzY2dsb2JhbABZFoMriDqXWpR0OoxQgSsDGAcOCDyCJQEBAQMBeQUWNGkUh3YIDc8lF4xfgXwHFoQiBJhEAYEylCg9 X-IPAS-Result: Au6sAAILHVNCJwNzY2dsb2JhbABZFoMriDqXWpR0OoxQgSsDGAcOCDyCJQEBAQMBeQUWNGkUh3YIDc8lF4xfgXwHFoQiBJhEAYEylCg9 X-Spam-Status: Yes X-IronPort-AV: E=Sophos;i="4.97,620,1389740400"; d="scan'208";a="62031000" Received: from www1.g3.pair.com ([66.39.3.115]) by mail2-smtp-roc.national.inria.fr with SMTP; 10 Mar 2014 01:47:27 +0100 Received: (qmail 65097 invoked by uid 9370); 10 Mar 2014 00:47:25 -0000 Date: 10 Mar 2014 00:47:25 -0000 Message-ID: <20140310004725.65096.qmail@www1.g3.pair.com> From: oleg@okmij.org To: raphlalou@gmail.com CC: caml-list@inria.fr, martin.jambon@ens-lyon.org In-reply-to: Subject: Re: [Caml-list] I never succeeded in using Format > Another alternative to format for pretty-printing code (or other things): PPrint > > Release blog post (with some examples of use): > http://gallium.inria.fr/blog/first-release-of-pprint/ > Documentation: http://gallium.inria.fr/~fpottier/pprint/doc/PPrint.html > Installation instruction: `opam install pprint` That formatter uses Wadler's Pretty-printer, which is not optimal. The optimal one takes linear time in the size of the document (regardless of the page width), and, for constant page width, formats documents of any size in constant space. It is obviously incremental and has bounded latency. There are several optimal formatters. The recent one was based on simple generators, described in http://okmij.org/ftp/continuations/PPYield/index.html#pp Curiously, a Clojure programmer has read our paper and re-wrote the algorithm in Clojure -- without any help from us. It seems he is very satisfied with the results: https://github.com/brandonbloom/fipp That web page has a few examples.