caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Re: Constructed types
@ 1999-01-21 15:37 Toby Moth
  0 siblings, 0 replies; 4+ messages in thread
From: Toby Moth @ 1999-01-21 15:37 UTC (permalink / raw)
  To: caml-list, Chris.Keane

I remembered this coming up before but have only just found the reference. The question of constructors was raised by Simon Clematide - 20 Jan 97 and answered by Xavier Leroy. Check out the archives for details.

Toby




^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: Constructed types
@ 1999-01-21 16:05 Markus Mottl
  0 siblings, 0 replies; 4+ messages in thread
From: Markus Mottl @ 1999-01-21 16:05 UTC (permalink / raw)
  To: OCAML

> I remembered this coming up before but have only just found the 
> reference.  The uestion of constructors was raised by Simon Clematide -
> 20 Jan 97 and nswered by Xavier Leroy. Check out the archives for
> details.

Ah, now everything is clear! Read the following page:

  http://caml.inria.fr/caml-list/0030.html

Regards,
Markus

-- 
Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl




^ permalink raw reply	[flat|nested] 4+ messages in thread
* Constructed types
@ 1999-01-20 10:42 Chris Keane
  1999-01-21  1:22 ` Markus Mottl
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Keane @ 1999-01-20 10:42 UTC (permalink / raw)
  To: caml-list

If this works as it should:

  >         Objective Caml version 2.00
  >
  > # type foo =
  >     Bar of int * int;;
  > type foo = | Bar of int * int
  > # let myfun x =
  >     let (m,n) = if x = 0 then (0,0) else (1,1) in
  >       Bar (m,n);;
  > val myfun : int -> foo = <fun>

then why doesn't this?

  > # let myfun2 x =
  >     let m = if x = 0 then (0,0) else (1,1) in
  >       Bar m;;
  > The constructor Bar expects 2 argument(s),
  > but is here applied to 1 argument(s)

or even this?

  > # let myfun3 x =
  >     Bar (if x = 0 then (0,0) else (1,1));;
  > The constructor Bar expects 2 argument(s),
  > but is here applied to 1 argument(s)

Thanks,
Chris.

------------------------------------------------------------------- ><> ---
    Hardware Compilation Group, Oxford University Computing Laboratory,
            Wolfson Building, Parks Road, Oxford, OX1 3QD, U.K.
    tel:  +44 (1865) (2)73865      e-mail:  Chris.Keane@comlab.ox.ac.uk
            http://www.comlab.ox.ac.uk/oucl/users/chris.keane/




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

end of thread, other threads:[~1999-01-21 18:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-01-21 15:37 Constructed types Toby Moth
  -- strict thread matches above, loose matches on Subject: below --
1999-01-21 16:05 Markus Mottl
1999-01-20 10:42 Chris Keane
1999-01-21  1:22 ` Markus Mottl

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