caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: a.baretta@studio.baretta.com
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] 'a & string unification issue
Date: Wed, 23 Aug 2006 08:24:59 +0900 (JST)	[thread overview]
Message-ID: <20060823.082459.99830220.garrigue@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <44EB38CA.8080800@studio.baretta.com>

From: Alessandro Baretta <a.baretta@studio.baretta.com>

> I'm back to my usual tuareg-mode session, and I'm back to my usual typing 
> trouble. Does the following error message, coming from a fresh installation of 
> ocaml 3.09.2, make any sense.
> 
> Values do not match:
>    val init :
>      [< `Odbc_driver of
>           [< `Default
>            | `Options of
>                [< `DSN of string ] * [< `User of string ] *
>                [< `Password of string ] ]
>       | `Pgsql_driver of
>           [< `Default
>            | `Options of
>                [< `Client_encoding of string
> 
> (* The problem seems to be here: shouldn't 'x & string unify trivially *)
> (* for any type variable 'x? *)
Indeed, so this is probably not the problem
>                 | `DB of 'a & string
>                 | `Debug_log of 'b & string
>                 | `Debug_options of 'c & string
>                 | `Host of 'd & string
>                 | `Hostaddr of 'e & string
>                 | `Password of 'f & string
>                 | `Port of 'g & int
>                 | `SSL of 'h & string
>                 | `User of 'i & string ]
>                list
>            | `String of string
The next line seems to be the problem:
>            > `Options ] ] ->
>      [> `Odbc_driver of Odbc_driver.pipeline
>       | `Pgsql_driver of Pgsql_driver.pipeline ]
> is not included in
>    val init :
>      [< `Odbc_driver of
>           [< `Default
>            | `Options of
>                [ `DSN of string ] * [ `User of string ] *
>                [ `Password of string ] ]
>       | `Pgsql_driver of
>           [< `Default
>            | `Options of
>                [< `Client_encoding of string
>                 | `DB of string
>                 | `Debug_log of string
>                 | `Debug_options of string
>                 | `Host of string
>                 | `Hostaddr of string
>                 | `Password of string
>                 | `Port of int
>                 | `SSL of string
>                 | `User of string ]
>                list
>            | `String of string ] ] ->
>      [> `Odbc_driver of Odbc_driver.pipeline
>       | `Pgsql_driver of Pgsql_driver.pipeline ]

Looks like your implementation contains at least `Options, while the
interface doesn't. Since it is in a contravariant position, you should
be able to remove it from the implementation by subtyping.

Jacques Garrigue


  reply	other threads:[~2006-08-22 23:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-22 17:03 Alessandro Baretta
2006-08-22 23:24 ` Jacques Garrigue [this message]
2006-08-24 14:51   ` [Caml-list] " Alessandro Baretta

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=20060823.082459.99830220.garrigue@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=a.baretta@studio.baretta.com \
    --cc=caml-list@inria.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).