Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Oliver Bandel <oliver@first.in-berlin.de>
To: Andrej.Bauer@andrej.com, Andrej Bauer <Andrej.Bauer@fmf.uni-lj.si>
Cc: Jonathan T Bryant <jtbryant@valdosta.edu>, caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Type issue
Date: Fri, 23 Nov 2007 10:27:53 +0100	[thread overview]
Message-ID: <1195810073.47469d1986cc0@webmail.in-berlin.de> (raw)
In-Reply-To: <47468EAC.1070602@fmf.uni-lj.si>

Zitat von Andrej Bauer <Andrej.Bauer@fmf.uni-lj.si>:

> Here's a simpler example:
>
> # fun (g, x) -> (g true, g x) ;;
> - : (bool -> 'a) * bool -> 'a * 'a = <fun>
>
> Even though it looks like g could be of type 'b -> 'a, ocaml decides to
> go with bool only. I see this on the mailing list every once in a while,
> but I always forget the reasoning behind it.
[...]

g true  ===>  g is a function applied to a bool; result-type unspecified.

g x     ===> x is a bool, because g is a function that takes a bool-arg;
             g is explained above.

So, with the application "g true"
you already have fixed the type!

Jonathan's problem is very similar.

Ciao,
   Oliver


  reply	other threads:[~2007-11-23  9:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-23  4:01 Jonathan T Bryant
2007-11-23  8:26 ` [Caml-list] " Andrej Bauer
2007-11-23  9:27   ` Oliver Bandel [this message]
2007-11-23  8:30 ` Florian Weimer
2007-11-23  9:14 ` Alain Frisch
2007-11-23 13:38   ` Arnaud Spiwack
2007-11-23 13:44     ` Vincent Aravantinos
2007-11-23  9:33 ` Oliver Bandel
2007-11-23 12:33 ` Angela Zhu

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=1195810073.47469d1986cc0@webmail.in-berlin.de \
    --to=oliver@first.in-berlin.de \
    --cc=Andrej.Bauer@andrej.com \
    --cc=Andrej.Bauer@fmf.uni-lj.si \
    --cc=caml-list@yquem.inria.fr \
    --cc=jtbryant@valdosta.edu \
    /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