caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* (int * int) <> int*int ?
@ 2006-02-23 17:28 Frédéric Gava
  2006-02-23 18:33 ` [Caml-list] " Eric Cooper
                   ` (3 more replies)
  0 siblings, 4 replies; 34+ messages in thread
From: Frédéric Gava @ 2006-02-23 17:28 UTC (permalink / raw)
  To: caml-list

Hi,

is anybody can semantically explain why this 2 types are differents ?

# type t=A of int*int and  t'= B of (int*int);;
type t = A of int * int
and t' = B of (int * int)

# A (2,3);;
- : t = A (2, 3)
# B (2,3);;
- : t' = B (2, 3)

# let a=2,3;;
val a : int * int = (2, 3)

# (A a);;
The constructor A expects 2 argument(s), but is here applied to 1
argument(s)
# (B a);;
- : t' = B (2, 3)

I understand that it'is force you to have a pair for A and not just a value
of type pair but why this restriction ? It is not easy to explain why
int*int <> (int*int).

Thanks !
Frédéric Gava



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

end of thread, other threads:[~2006-03-01 13:01 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-23 17:28 (int * int) <> int*int ? Frédéric Gava
2006-02-23 18:33 ` [Caml-list] " Eric Cooper
2006-02-23 19:03   ` Martin Jambon
2006-02-23 19:07   ` Frédéric Gava
2006-02-23 20:15     ` Brian Hurt
2006-02-23 21:30       ` Frédéric Gava
2006-02-23 21:57         ` Brian Hurt
2006-02-23 22:30           ` Frédéric Gava
2006-02-23 22:50             ` Brian Hurt
2006-02-23 23:07               ` Frédéric Gava
2006-02-24  8:38     ` Alessandro Baretta
2006-02-24 12:59     ` Damien Doligez
2006-02-23 18:33 ` Thomas Fischbacher
2006-02-23 18:56 ` David Brown
2006-02-23 19:24   ` Frédéric Gava
2006-02-23 19:37   ` Frédéric Gava
2006-02-23 19:45     ` Frédéric Gava
2006-02-24  0:01       ` Jacques Garrigue
2006-02-24  0:18         ` Lukasz Stafiniak
2006-02-24  2:17           ` Jacques Garrigue
2006-02-24 13:07             ` Alain Frisch
2006-02-25 17:42               ` Vincent Balat
2006-02-25 18:30                 ` Nicolas Pouillard
2006-02-25 19:09                   ` Richard Jones
2006-03-01 12:48                     ` Nicolas Pouillard
2006-02-25 23:17                   ` Christophe TROESTLER
2006-03-01 13:01                     ` Nicolas Pouillard
2006-02-27 11:14                   ` camlp4 renovation [was: [Caml-list] (int * int) <> int*int ?] Hendrik Tews
2006-02-24 13:39             ` [Caml-list] (int * int) <> int*int ? Nicolas Cannasse
2006-02-24 14:49               ` Frédéric Gava
2006-02-24  8:27   ` also for tagged records? [Was: Re: [Caml-list] (int * int) <> int*int ?] Sebastian Egner
2006-02-24 14:01     ` Thomas Fischbacher
2006-02-23 20:58 ` [Caml-list] (int * int) <> int*int ? Jon Harrop
2006-02-23 21:36   ` Frédéric Gava

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