caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Matthieu Wipliez <mwipliez@yahoo.fr>
To: caml-list <caml-list@inria.fr>
Subject: Re : [Caml-list] Warning wished
Date: Wed, 28 Jan 2009 14:07:22 +0000 (GMT)	[thread overview]
Message-ID: <739317.49579.qm@web27001.mail.ukl.yahoo.com> (raw)
In-Reply-To: <1233150828.7199.213.camel@localhost>

> Hello,
> 
> Is it a bug or a well-known feature that the above program does not emit
> a warning (because "f x" should have type unit in the body of "g") ?
> 
> =====
> let f x = x
> let g x = f x; 1
> (* let _ = g 2 *)
> ====

I'm not familiar with the internals of the compiler, but what I suppose is happening is that it tries to unify the type of "f x" and "unit", and this succeeds because "f x" has type 'a, which can be unified with anything. The meaning of "a;b" seems to be let _ = a in b rather than let () = a in b.

But like I said, these are suppositions.

Cheers,
Matthieu

> 
> Best regards,
> Julien Signoles
> 
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs






  reply	other threads:[~2009-01-28 14:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-28 13:53 Julien SIGNOLES
2009-01-28 14:07 ` Matthieu Wipliez [this message]
2009-01-28 14:24   ` Re : [Caml-list] " Julien SIGNOLES
2009-01-28 20:56     ` Nicolas Pouillard
2009-01-28 14:10 ` Dmitri Boulytchev
2009-01-28 14:28   ` Julien SIGNOLES
2009-01-28 14:44     ` Dmitri Boulytchev
2009-01-28 18:29       ` Frédéric van der Plancke
2009-01-28 19:08         ` Dmitri Boulytchev
2009-01-28 16:55 ` Martin Jambon

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=739317.49579.qm@web27001.mail.ukl.yahoo.com \
    --to=mwipliez@yahoo.fr \
    --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).