From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA02112; Mon, 24 Sep 2001 13:14:36 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA02108 for ; Mon, 24 Sep 2001 13:14:35 +0200 (MET DST) Received: from dpt-info.u-strasbg.fr (dpt-info.u-strasbg.fr [130.79.44.193]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f8OBEYX17519 for ; Mon, 24 Sep 2001 13:14:35 +0200 (MET DST) Received: (from luther@localhost) by dpt-info.u-strasbg.fr (8.9.3/8.9.3) id NAA19174; Mon, 24 Sep 2001 13:14:28 +0200 Date: Mon, 24 Sep 2001 13:14:27 +0200 From: Sven To: Dave Mason Cc: Mattias Waldau , Arturo Borquez , steven@murdomedia.net, caml-list@inria.fr Subject: Re: [Caml-list] Haskell features in O'Caml Message-ID: <20010924131427.A19055@dpt-info.u-strasbg.fr> References: <200109231750.f8NHoLp03884@sarg.ryerson.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <200109231750.f8NHoLp03884@sarg.ryerson.ca>; from dmason@sarg.ryerson.ca on Sun, Sep 23, 2001 at 01:50:21PM -0400 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sat, 22 Sep 2001 13:50:11 +0200, Steven Murdoch wrote: > The main one I would like is the type assertion facility of Haskell. > For example, one might write: > mul :: Int -> Int -> Int > mul a b = a * b > On Sun, 23 Sep 2001 18:08:36 +0200, Florian Hars wrote: > # module M : sig > val mul : int -> int -> int > end = struct > let mul a b = a * b > end;; > module M : sig val mul : int -> int -> int end > On Sun, 23 Sep 2001 18:21:07 +0200, "Mattias Waldau" wrote: > # let mul (a:int) (b:int) : int = a*b;; > val mul : int -> int -> int = > On Sun, Sep 23, 2001 at 01:50:21PM -0400, Dave Mason wrote: > > # let (mul : int -> int -> int) = fun x y -> x*y;; > val mul : int -> int -> int = > But you have to recognize that non of these solution is as elegant as the haskel way of doing it, isn't ti ? maybe this would be nice : val mul : int -> int -> int let mul x y = ... Sure, i know the right way is to put the declaration of mul in a separate file, but still, it would be nice to be able to do it in one file only. Friendly, Sven Luthert ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr