caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Till Varoquaux" <till.varoquaux@gmail.com>
To: "ocaml ml" <caml-list@inria.fr>
Subject: coercions issues
Date: Mon, 12 Mar 2007 21:11:52 +0100	[thread overview]
Message-ID: <9d3ec8300703121311h32b09b1by2955d658238d8a02@mail.gmail.com> (raw)

I still can't wrap my head around the whole polymorphic variant of
Ocaml (although I am making steady progresses). Anyways here is my
latest sore point:

This expression cannot be coerced to type
  O.o Ast.T.expr O.m = O.o Ast.T.expr Mon.m;
it has type O.o Ast_js.T.expr Mon.m but is here used with type
  O.o Ast.T.expr O.m = O.o Ast.T.expr Mon.m
Type
  O.o Ast_js.T.expr =
    [ `Binop of To.binop * To.expr * To.expr
    | `Cst of To.constant
    | `Ecall of To.ident * To.arg list
    | `Fun of To.ident list * To.bloc
    | `Lval of To.lvalue
    | `Unop of To.unop * To.expr ]
is not compatible with type
  O.o Ast.T.expr =
    [ `Binop of To.binop * To.expr * To.expr
    | `Cst of To.constant
    | `Ecall of To.ident * To.arg list
    | `Epos of Ast.location * To.expr
    | `Fun of To.ident list * To.bloc
    | `Lval of To.lvalue
    | `Unop of To.unop * To.expr ]
The first variant type does not allow tag(s) `Epos

I am a little confused as to why this coercion is impossible... It
looks like a simple upward cast to me.
Cheers,
Till


             reply	other threads:[~2007-03-12 20:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-12 20:11 Till Varoquaux [this message]
2007-03-12 21:11 ` [Caml-list] " Chris King
2007-03-12 21:35   ` Till Varoquaux

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=9d3ec8300703121311h32b09b1by2955d658238d8a02@mail.gmail.com \
    --to=till.varoquaux@gmail.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).