caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Type issue
@ 2007-11-23  4:01 Jonathan T Bryant
  2007-11-23  8:26 ` [Caml-list] " Andrej Bauer
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Jonathan T Bryant @ 2007-11-23  4:01 UTC (permalink / raw)
  To: caml-list

List,

I don't understand the following typing:

# type 'a t = Cond of bool t * 'a t * 'a t | Value of 'a;;
type 'a t = Cond of bool t * 'a t * 'a t | Value of 'a

# let rec f t = match t with
      Cond (c,t,e) -> if f c then f t else f e
    | Value x -> x
  ;;
val f : bool t -> bool = <fun>

I don't understand why f isn't of type 'a t -> 'a.  I understand that f 
is applied to a bool t, but I would think that that would just be a 
particular instantiation of 'a, not enough to fully determine its type.

--Jonathan Bryant


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-11-23 13:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-23  4:01 Type issue Jonathan T Bryant
2007-11-23  8:26 ` [Caml-list] " Andrej Bauer
2007-11-23  9:27   ` Oliver Bandel
2007-11-23  8:30 ` Florian Weimer
2007-11-23  9:14 ` Alain Frisch
2007-11-23 13:38   ` Arnaud Spiwack
2007-11-23 13:44     ` Vincent Aravantinos
2007-11-23  9:33 ` Oliver Bandel
2007-11-23 12:33 ` Angela Zhu

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).