From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA32371 for caml-redistribution; Wed, 20 Jan 1999 14:03:21 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA00310 for ; Wed, 20 Jan 1999 11:42:23 +0100 (MET) Received: from mail.comlab.ox.ac.uk (mail.comlab.ox.ac.uk [163.1.27.1]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id LAA29399 for ; Wed, 20 Jan 1999 11:42:22 +0100 (MET) Received: from comlab.ox.ac.uk (root@msc2.comlab.ox.ac.uk [163.1.88.102]) by mail.comlab.ox.ac.uk (M1.2/8.8.8) with ESMTP id KAA21014; Wed, 20 Jan 1999 10:42:21 GMT Received: from msc2.comlab (cjk@localhost [127.0.0.1]) by msc2.comlab (comlab4.7/8.8.8) with ESMTP id KAA01535; Wed, 20 Jan 1999 10:42:19 GMT Message-Id: <199901201042.KAA01535@msc2.comlab> X-url: http://www.comlab.ox.ac.uk/oucl/users/chris.keane/ X-pgp-fingerprint: 71 6B 65 95 ED E8 F6 2C ED 0D 44 A1 8B 3D CE B5 X-Face: "A~'"UHp`(\.?@U2R^o=[xou1xAn!xpfI[D6Q?{uRUUKe&xOe4h@GQ8XAUqmAG(U=-$x@pBa$C1g6}0g^".#2$DX(.!zU?5k8J{sK}B\G'UB&*,d;O'('c@18 Organization: Oxford University Computing Laboratory X-Address: Wolfson Building, Parks Road, Oxford, OX1 3QD, U.K. X-Phone: +44 (1865) (2)73865 To: caml-list@inria.fr Subject: Constructed types Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 20 Jan 1999 10:42:18 +0000 From: Chris Keane Sender: weis 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 = 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/