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 SAA32432 for caml-redistribution@pauillac.inria.fr; Mon, 21 Feb 2000 18:08:46 +0100 (MET) Resent-Message-Id: <200002211708.SAA32432@pauillac.inria.fr> 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 VAA17604 for ; Fri, 18 Feb 2000 21:47:35 +0100 (MET) Received: from cepheus.azstarnet.com (cepheus.azstarnet.com [169.197.56.195]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id VAA16816 for ; Fri, 18 Feb 2000 21:47:32 +0100 (MET) Received: from vega (dialup14ip056.tus.azstarnet.com [169.197.36.184]) by cepheus.azstarnet.com (8.9.3+blt.Beta0/8.9.3) with SMTP id NAA13154 for ; Fri, 18 Feb 2000 13:47:30 -0700 (MST) X-Sent-via: StarNet http://www.azstarnet.com/ Message-ID: <000501bf7a51$60490100$250148bf@vega> From: "David McClain" To: Subject: Dichotomy between functions and type constructors? Date: Fri, 18 Feb 2000 13:47:28 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Resent-From: weis@pauillac.inria.fr Resent-Date: Mon, 21 Feb 2000 18:08:46 +0100 Resent-To: caml-redistribution@pauillac.inria.fr I am curious about the apparent dichotomy between normal functions and type constructors, and why this disparity exists? Say I have a type type thing = T1 of int * float | .... I can create such a type as T1(5, 3.14) but I cannot create such a type on a tuple result of a function call: let doit x = (x, float_of_int x) let myT1 = T1(doit x) This gives rise to a type checking error wherein the constructor T1 demands two arguments, instead of demanding a tuple of two elements. SML does not appear to impose this same requirement on the programmer, so what is the origin of the OCaml requirement? TIA, David McClain, Sr. Scientist Raytheon Systems Co. Tucson, AZ