caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Vsevolod Fedorov" <sevaAtWork@mail.ru>
To: <caml-list@yquem.inria.fr>
Subject: function specialization
Date: Tue, 15 Nov 2005 14:45:40 +0300	[thread overview]
Message-ID: <00a701c5e9da$1b0ebc20$670aa8c0@seva> (raw)

Hello!

I have code like following:
----

type 'a wrap = ('a -> unit) -> 'a -> unit

let wrap fn arg =
  fn arg

let fn1 (v: int)    = ()
let fn2 (v: string) = ()

let use (wrap: 'a wrap) =
  wrap fn1 1;
  wrap fn2 ""
  (*   ^^^ This expression has type string -> unit but is here used with
type int -> unit *)

------
and get this error from compiler.
Is there any way to use 'wrap' function for both cases: fn1 and fn2?
Or is there some 'standard' workarounds/solutions for this problem exists?

Thanks
Seva



             reply	other threads:[~2005-11-15 11:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-15 11:45 Vsevolod Fedorov [this message]
2005-11-15 12:57 ` [Caml-list] " Alessandro Baretta
2005-11-15 13:00 ` Jørgen Hermanrud Fjeld
2005-11-15 13:11 ` skaller

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='00a701c5e9da$1b0ebc20$670aa8c0@seva' \
    --to=sevaatwork@mail.ru \
    --cc=caml-list@yquem.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).