caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Sexplib and types defined via constraint
@ 2008-07-25 12:31 Dario Teixeira
  2008-07-25 20:04 ` [Caml-list] " Markus Mottl
  0 siblings, 1 reply; 4+ messages in thread
From: Dario Teixeira @ 2008-07-25 12:31 UTC (permalink / raw)
  To: caml-list

Hi,

I've been using Sexplib quite extensively.  The syntax extension makes adding
(de)serialisation functions very simple and convenient, and up till now it
has automatically handled every data structure I threw at it.

But consider the module fragment below; type t is defined via a constraint,
and includes a type parameter ('b) used as a phantom type.  The Sexplib syntax
extension fails to parse the definition of t, producing an error:

Failure: "get_tparam_id: not a type parameter"
Preprocessing error on file document.ml

Is this a known limitation of Sexplib, in which case the (de)serialization
functions for t must be built manually?

Thanks in advance,
Dario Teixeira


module rec Foobar:
sig
        type foo_t = [ `A of int | `B of Foobar.bar_t ] with sexp
        type bar_t = [ `C of int | `D of Foobar.foo_t ] with sexp
        type foobar_t = [ foo_t | bar_t ] with sexp

        type (+'a, 'b) t = private Foobar of 'a constraint 'a = [< foobar_t ] with sexp
end =
struct
        type foo_t = [ `A of int | `B of Foobar.bar_t ] with sexp
        type bar_t = [ `C of int | `D of Foobar.foo_t ] with sexp
        type foobar_t = [ foo_t | bar_t ] with sexp

        type (+'a, 'b) t = Foobar of 'a constraint 'a = [< foobar_t ] with sexp
end



      __________________________________________________________
Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Sexplib and types defined via constraint
  2008-07-25 12:31 Sexplib and types defined via constraint Dario Teixeira
@ 2008-07-25 20:04 ` Markus Mottl
  2008-07-25 21:43   ` Stefano Zacchiroli
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Mottl @ 2008-07-25 20:04 UTC (permalink / raw)
  To: Dario Teixeira; +Cc: caml-list

On Fri, Jul 25, 2008 at 8:31 AM, Dario Teixeira <darioteixeira@yahoo.com> wrote:
> But consider the module fragment below; type t is defined via a constraint,
> and includes a type parameter ('b) used as a phantom type.  The Sexplib syntax
> extension fails to parse the definition of t, producing an error:
>
> Failure: "get_tparam_id: not a type parameter"
> Preprocessing error on file document.ml

Thanks for reporting this, this is a bug in type-conv (i.e. affects
bin-prot, too).  Though we also make use of variance annotations, we
have surprisingly never used them in structures, only in signatures.
That's why this bug went unspotted until now.

An updated version is online already, including the Godi-package.

Best regards,
Markus

-- 
Markus Mottl http://www.ocaml.info markus.mottl@gmail.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Sexplib and types defined via constraint
  2008-07-25 20:04 ` [Caml-list] " Markus Mottl
@ 2008-07-25 21:43   ` Stefano Zacchiroli
  2008-07-25 22:36     ` Markus Mottl
  0 siblings, 1 reply; 4+ messages in thread
From: Stefano Zacchiroli @ 2008-07-25 21:43 UTC (permalink / raw)
  To: caml-list

On Fri, Jul 25, 2008 at 04:04:25PM -0400, Markus Mottl wrote:
> An updated version is online already, including the Godi-package.

Shameless plug: what about a release of Core? There is still the bogus
requirement of the findlib "thread" module which I believe you have
already fixed upstream, can you make a release with that fix?

Many thanks for the nice bits of software though!
Cheers.

-- 
Stefano Zacchiroli -*- PhD in Computer Science \ PostDoc @ Univ. Paris 7
zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/
I'm still an SGML person,this newfangled /\ All one has to do is hit the
XML stuff is so ... simplistic  -- Manoj \/ right keys at the right time


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Sexplib and types defined via constraint
  2008-07-25 21:43   ` Stefano Zacchiroli
@ 2008-07-25 22:36     ` Markus Mottl
  0 siblings, 0 replies; 4+ messages in thread
From: Markus Mottl @ 2008-07-25 22:36 UTC (permalink / raw)
  To: Stefano Zacchiroli; +Cc: caml-list

On Fri, Jul 25, 2008 at 5:43 PM, Stefano Zacchiroli <zack@upsilon.cc> wrote:
> Shameless plug: what about a release of Core? There is still the bogus
> requirement of the findlib "thread" module which I believe you have
> already fixed upstream, can you make a release with that fix?

We currently don't have any formalized process for releases.  There is
a very substantial number of patches that have gone into our upstream
version, and somebody will have to review them before the release.
But we are certainly committed to keeping the library well-maintained,
and you can reasonably expect releases to happen in somewhat
infrequent time intervals.

Best regards,
Markus

-- 
Markus Mottl http://www.ocaml.info markus.mottl@gmail.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-07-25 22:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-25 12:31 Sexplib and types defined via constraint Dario Teixeira
2008-07-25 20:04 ` [Caml-list] " Markus Mottl
2008-07-25 21:43   ` Stefano Zacchiroli
2008-07-25 22:36     ` Markus Mottl

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).