caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Brian Hurt <bhurt@spnz.org>
To: Keiko Nakata <keiko@kurims.kyoto-u.ac.jp>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] any types in signatures of functor arguments
Date: Mon, 24 Oct 2005 09:08:05 -0500 (CDT)	[thread overview]
Message-ID: <Pine.LNX.4.63.0510240902280.30465@localhost.localdomain> (raw)
In-Reply-To: <20051024.175154.68545642.keiko@kurims.kyoto-u.ac.jp>



On Mon, 24 Oct 2005, Keiko Nakata wrote:

> Hello.
>
> Why I cannot have *any types* in signatures of functor arguments?
> Concretely, the following F is not typable.
>
> module F(X:sig type t = [`A of _ ] val f : t -> int end) =
>  struct
>    let f = function `A x as a -> X.f a | `B -> 0
>  end

I think the problem is that `A holds something, but you're not giving 
Ocaml any idea of what.  For example, the following compiles:

module F(X:sig type 'a t = [`A of 'a ] val f : 'a t -> int end) =
   struct
     let f = function `A x as a -> X.f a | `B -> 0
   end

Hope this helps.

Brian


  reply	other threads:[~2005-10-24 14:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-24  8:51 Keiko Nakata
2005-10-24 14:08 ` Brian Hurt [this message]
2005-10-25  2:22   ` [Caml-list] " Keiko Nakata
2005-10-25  8:53     ` Virgile Prevosto
2005-10-25  9:49       ` Keiko Nakata
2005-10-25 10:08         ` fva en UMBRIEL
2005-10-25 12:15 ` Hendrik Tews

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=Pine.LNX.4.63.0510240902280.30465@localhost.localdomain \
    --to=bhurt@spnz.org \
    --cc=caml-list@inria.fr \
    --cc=keiko@kurims.kyoto-u.ac.jp \
    /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).