caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Keiko Nakata <keiko@kurims.kyoto-u.ac.jp>
To: garrigue@math.nagoya-u.ac.jp
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] again private rows question
Date: Fri, 11 Nov 2005 15:27:43 +0900 (JST)	[thread overview]
Message-ID: <20051111.152743.125102970.keiko@kurims.kyoto-u.ac.jp> (raw)
In-Reply-To: <20051111.144247.68530040.keiko@kurims.kyoto-u.ac.jp>

Sorry, again...

What is the difference beteen the functor F and the function f ?
(F is not typable, but f is)

module F(X:sig  
  type t = private [< `A | `B | `C ]
  val f : [`III ] -> t end) = 
  struct
    let rec g  = function
	[] -> []
      | `I  :: tl -> `A :: (g tl)
      | `II :: tl -> `B :: (g  tl)
      | (`III as iii) :: tl  -> 
	  let iii' = (X.f iii : [< `A | `B | `C ] :> [> `A | `B ]) in
	  iii' :: (g tl)
  end


let f (x : [< `A | `B | `C]) = (x : [< `A | `B | `C] :> [> `A | `B]);;

I also curious to know whether there is a way to 
make g's type depend on X.t in 

module G(X:sig type t = private [< `A ] val f : int -> t end) = struct
  let g x = if x = 0 then `B else X.f x 
end


Regards, 
Keiko NAKATA


      reply	other threads:[~2005-11-11  6:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-10  3:50 Keiko Nakata
2005-11-11  5:12 ` [Caml-list] " Jacques Garrigue
2005-11-11  5:42   ` Keiko Nakata
2005-11-11  6:27     ` Keiko Nakata [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=20051111.152743.125102970.keiko@kurims.kyoto-u.ac.jp \
    --to=keiko@kurims.kyoto-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=garrigue@math.nagoya-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).