Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
To: Kirill <kirillkh@gmail.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] weird type behavior
Date: Sat, 28 Oct 2006 17:12:27 +0100	[thread overview]
Message-ID: <20061028161226.GA28781@furbychan.cocan.org> (raw)
In-Reply-To: <1162050549.23148.26.camel@nfnl>

On Sat, Oct 28, 2006 at 05:49:08PM +0200, Kirill wrote:
> I'm a novice user of OCaml and functional languages in general. While
> playing with the interpreter, writing all kinds of functions, I've run
> into a behavior that doesn't look quite right to me. Please excuse me,
> if it is explained somewhere and I simply haven't gotten there yet.
> 
> In the following example, I define a simple function foo that returns
> function bar, which, in turn, accepts 2 parameters. The weird part is
> that after bar is being called for the first time, its signature changes
> from polymorphic types to ints. Right after (foo 3) call it's
>   '_a -> '_b -> '_b = <fun>
> But after being called, it becomes
>   (int -> int) -> int -> int = <fun>

Type variables like '_a are covered here:

http://caml.inria.fr/pub/old_caml_site/FAQ/FAQ_EXPERT-eng.html#variables_de_types_faibles

There's a mailing list for beginners' questions:

http://tech.groups.yahoo.com/group/ocaml_beginners/

Rich.

-- 
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Internet Marketing and AdWords courses - http://merjis.com/courses - NEW!
Merjis blog - http://blog.merjis.com - NEW!


  reply	other threads:[~2006-10-28 16:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-28 15:49 Kirill
2006-10-28 16:12 ` Richard Jones [this message]
2006-10-28 17:17   ` [Caml-list] " Kirill
     [not found]   ` <20061028161506.GA2596@furbychan.cocan.org>
     [not found]     ` <1162083950.23148.58.camel@nfnl>
2006-10-29  1:12       ` Kirill
2006-10-29  1:34         ` Kirill
2006-10-29  5:07         ` skaller
2006-10-29 10:03   ` Boris Yakobowski

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=20061028161226.GA28781@furbychan.cocan.org \
    --to=rich@annexia.org \
    --cc=caml-list@yquem.inria.fr \
    --cc=kirillkh@gmail.com \
    /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