caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: Fabrice Marchant <fabrice.marchant@orange.fr>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Please a simple Camlp5 example
Date: Thu, 28 Feb 2008 17:15:24 +0000	[thread overview]
Message-ID: <20080228171523.GA13606@annexia.org> (raw)
In-Reply-To: <20080228164737.45250e33@orange.fr>

On Thu, Feb 28, 2008 at 04:47:37PM +0100, Fabrice Marchant wrote:
> 
>   Hi !
> 
>   Aware that this belongs to beginners-list, I first posted there
> three weeks ago, but without any answer :
> 
>   I bet this kind of code should be rather common :
> 
> let string_of_piece_type = function
>   King   -> "King"
> | Queen  -> "Queen"
> | Rook   -> "Rook"
> | Bishop -> "Bishop"
> | Knight -> "Knight"
> | Pawn   -> "Pawn"
> 
>  Please have you got an example where the macro helps to implement such kind of "string_of_type" function ?

You probably want to look at deriving (http://code.google.com/p/deriving/)
or tywith (http://www.seedwiki.com/wiki/shifting_focus/tywith) which
can generate these functions automatically.

Rich.

-- 
Richard Jones
Red Hat


      reply	other threads:[~2008-02-28 17:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-28 15:47 Fabrice Marchant
2008-02-28 17:15 ` Richard Jones [this message]

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=20080228171523.GA13606@annexia.org \
    --to=rich@annexia.org \
    --cc=caml-list@yquem.inria.fr \
    --cc=fabrice.marchant@orange.fr \
    /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).