Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: rixed@happyleptic.org
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] keeping parameter polymorphic
Date: Thu, 4 Oct 2012 15:13:13 +0200	[thread overview]
Message-ID: <CAPFanBFwksgi-Gk0TJfK3e0BQo8LNs0OrvjaeexZZY67rTx7Ag@mail.gmail.com> (raw)
In-Reply-To: <20121004130310.GA20285@securactive.lan>

Hi,

See the following FAQ item: "How to write a function with polymorphic
arguments?"
  http://caml.inria.fr/resources/doc/faq/core.en.html#polymorphic-arguments

On Thu, Oct 4, 2012 at 3:03 PM,  <rixed@happyleptic.org> wrote:
> Hello.
> I can't find a way to keep f polymorphic in:
>
> let test f = f 1, f true
>
> that I'd like to return a int*bool from any function 'a->'a
>
> I now this question regularly pops up, but I've tried many combinations
> of "(type a)" and "'a." to no avail (ocaml 3.12.1 here).
>
> (in real world, my function takes a generic "fold" function that I'd
> like to use with various types).
>
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

      reply	other threads:[~2012-10-04 13:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-04 13:03 rixed
2012-10-04 13:13 ` Gabriel Scherer [this message]

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=CAPFanBFwksgi-Gk0TJfK3e0BQo8LNs0OrvjaeexZZY67rTx7Ag@mail.gmail.com \
    --to=gabriel.scherer@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=rixed@happyleptic.org \
    /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