English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Newbie question: OCaml equivalent of Haskell's show?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-07-07 (19:08)
From: Jeremy Yallop <jeremy.yallop@e...>
Subject: Re: [Caml-list] Newbie question: OCaml equivalent of Haskell's show?
Richard Jones wrote:
> On Sun, Jul 06, 2008 at 11:33:35AM -0400, Antony Courtney wrote:
>> I'm an experienced Haskell hacker trying OCaml for the first time.
>> One thing I am desperately searching for but have been unable to find
>> is some direct runtime access to the string representation of
>> arbitrary OCaml values.
>   http://code.google.com/p/deriving/

For what it's worth, with deriving you can obtain a string 
representation of your value (`v', say) like this:

    Show.show<float option array array> v