From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 96C5FBBAF for ; Wed, 11 Mar 2009 06:56:45 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AosCAE7vtknCpx6vmWdsb2JhbACVLgEBAQEBCAsKBxG8KIQNBmE X-IronPort-AV: E=Sophos;i="4.38,339,1233529200"; d="scan'208";a="22361285" Received: from smtpka.univ-orleans.fr (HELO ka.univ-orleans.fr) ([194.167.30.175]) by mail2-smtp-roc.national.inria.fr with ESMTP; 11 Mar 2009 06:56:45 +0100 Received: from smtps.univ-orleans.fr (localhost [127.0.0.1]) by ka.univ-orleans.fr (Postfix) with ESMTP id 71F7112AD59; Wed, 11 Mar 2009 06:56:45 +0100 (CET) Received: from [192.168.0.1] (lau18-1-82-246-197-195.fbx.proxad.net [82.246.197.195]) by smtps.univ-orleans.fr (Postfix) with ESMTP id BD66A36E60; Wed, 11 Mar 2009 06:56:44 +0100 (CET) Subject: Re: [Caml-list] stl? From: David Rajchenbach-Teller To: Brian Hurt Cc: Jon Harrop , caml-list@yquem.inria.fr In-Reply-To: References: <91a2ba3e0903031340wcdc976cp52522eb35f7ccb73@mail.gmail.com> <87ab81yrog.fsf@aryx.cs.uiuc.edu> <200903042303.07629.jon@ffconsultancy.com> Content-Type: text/plain; charset=utf-8 Date: Wed, 11 Mar 2009 06:57:10 +0100 Message-Id: <1236751030.6424.5.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; stl:01 ens-lyon:01 comming:01 ord:01 foo:01 foo:01 ord:01 struct:01 functor:01 functors:01 ocaml:01 cheers:01 univ-orleans:01 lifo:01 2009:98 On Tue, 2009-03-10 at 23:16 -0400, Brian Hurt wrote: > This isn't a limitation of the language, this is simply a short comming of > the standard libraries. It works in Batteries, btw. > Ord t => let foo (x: t) (y : t) = ... > > is the same as: > > module Foo(X: Ord) = struct > type t = X.t;; > open X;; > let foo (x: t) (y: t) = ... > end;; > > or something. And some similar bit of syntactic sugar to make > instantiating a functor lower cost as well. Obviously this idea has some > problems. My point is that is that it should be possible to come up with > some sort of reasonable extension of the language to allow functors to be > more "type-class like". How would you determine that "=>" or "foo" maps to "Foo"? IMHO, that's the main problem with getting typeclasses in OCaml. Cheers, David -- David Teller-Rajchenbach Security of Distributed Systems http://www.univ-orleans.fr/lifo/Members/David.Teller « Ce matin Un crétin A tué un chercheur. » (air connu) Latest News of French Research: System being liquidated. Researchers angry.