caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alain Frisch <alain@frisch.fr>
To: Edgar Friendly <thelema314@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Generic printer patch
Date: Thu, 08 Dec 2011 10:00:39 +0100	[thread overview]
Message-ID: <4EE07CB7.6090106@frisch.fr> (raw)
In-Reply-To: <4EE02213.70200@gmail.com>

On 12/08/2011 03:33 AM, Edgar Friendly wrote:
> On 12/07/2011 10:28 AM, Jérémie Dimino wrote:
>> Hi,
>>
>> I have made a patch for ocaml 3.12.1 which allow to have a generic
>> printing function. The patch is available here:
>>
>> external show : 'a -> string = "%show"
>>
>> Of course it is limited to what the compiler knows, for example the
>> following function will always returns "[<poly>;<poly>]":
>
> I'm interested in having compile-time reflection like this, but maybe
> with a bit more generality.

You might be interested in my proposal to extend OCaml with a notion of 
runtime representation of types:

http://www.lexifi.com/blog/runtime-types

A generic value pretty-printer can be written in "user-land" using this 
extension (in a type-safe way).


-- Alain

  parent reply	other threads:[~2011-12-08  9:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-07 15:28 Jérémie Dimino
2011-12-07 16:46 ` Alex Rubinsteyn
2011-12-07 17:10   ` Jérémie Dimino
2011-12-07 16:56 ` François Bobot
2011-12-07 17:34   ` Jérémie Dimino
2011-12-08 12:00     ` Romain Bardou
2011-12-08 14:21       ` Gerd Stolpmann
2011-12-08 18:20       ` Martin Jambon
2011-12-08 21:39         ` Gabriel Scherer
2011-12-09  7:22           ` Jérémie Dimino
2011-12-09  9:26             ` Gabriel Scherer
2011-12-09  7:15         ` Jérémie Dimino
2011-12-08  2:33 ` Edgar Friendly
2011-12-08  7:28   ` François Bobot
2011-12-08  9:00   ` Alain Frisch [this message]
2011-12-08  9:24     ` Gerd Stolpmann
2011-12-08 10:32       ` Alain Frisch
2011-12-08 10:41         ` Jonathan Protzenko
2011-12-08 12:00           ` Philippe Veber
2011-12-08  5:26 ` Martin Jambon
2011-12-08  6:52   ` Jérémie Dimino
2011-12-08  7:44     ` Martin Jambon
2011-12-08  9:37       ` Jérémie Dimino

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=4EE07CB7.6090106@frisch.fr \
    --to=alain@frisch.fr \
    --cc=caml-list@inria.fr \
    --cc=thelema314@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).