Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Jeff Polakow <jpolakow@gnp.com>
To: caml-list@inria.fr
Subject: [Caml-list] strange match error
Date: Mon, 11 Mar 2002 14:33:46 -0800	[thread overview]
Message-ID: <3C8D30CA.C8CAAD91@gnp.com> (raw)

Hello,

I ran into a strange (I think) error and was wondering if someone
out there can help me out.

Why does the following program:
  type tt = A of string * int | B;;
  let f x = print_string ((fst x)^"\n");;
  let g x = match x with A y -> f y | B -> ();;

produce the following response from ocaml?
  # #use "caml_test.ml";;
  type tt = A of string * int | B
  val f : string * 'a -> unit = <fun>
  File "caml_test.ml", line 3, characters 23-26:
  The constructor A expects 2 argument(s), but is here applied to 1
argument(s)

Shouldn't the type reconstructor/checker realize that y is a pair?

thanks,
  Jeff
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


             reply	other threads:[~2002-03-11 22:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-11 22:33 Jeff Polakow [this message]
2002-03-11 23:35 ` Johan Georg Granström

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=3C8D30CA.C8CAAD91@gnp.com \
    --to=jpolakow@gnp.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