caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Diego Olivier FERNANDEZ PONS <diego.fernandez_pons@etu.upmc.fr>
To: Luc Maranget <luc.maranget@inria.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Why + vs +. but "fake" parametric polymorphism for <
Date: Fri, 13 Oct 2006 15:15:08 +0200	[thread overview]
Message-ID: <20061013151508.2ta6v6y5k4sc80co@webmail.etu.upmc.fr> (raw)
In-Reply-To: <20061013130100.GA10977@yquem.inria.fr>

     Bonjour,

Quoting Luc Maranget <luc.maranget@inria.fr>:
>>> This is simply the logic of the .mli.
>>
>> Very well, but why ?
>
> By design, I guess.

Oui mais pourquoi ?

Allez... je retombe en enfance.

Quand j'étais petit, j'ai voulu mettre une annotation de type dans mon  
code Caml du genre:
val fib : int -> int
let rec fib = function ...

Et on m'a dit "Ah non mon garçon, ça c'est du Haskell. En Caml on met  
les annotations dans le .mli, c'est d'ailleurs ça le _veritable_  
esprit de l'inférence de types : ne pas avoir besoin d'écrire de types".

Il faut reconnaître que l'on a tout fait pour rendre les annotations  
de type dans le code totalement illisibles - comparativement à Haskell  
par exemple. Et tout fait pour que le .mli soit aisément utilisable  
(Ctrl-C Ctrl-A sous Emacs, outils de documentation, etc.)

Mais après on me dit que si je mets mes annotations de type dans le  
.mli c'est moins bien que si je les mets dans le .ml avec la syntaxe  
illisible car les optimisations ne sont pas faites.

Et l'esprit de l'inférence de types alors ?

         Diego Olivier


  reply	other threads:[~2006-10-13 13:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-12  5:18 Carlos Pita
2006-10-12  5:45 ` [Caml-list] " Jacques Garrigue
2006-10-12  5:58   ` Carlos Pita
2006-10-12  6:08     ` Jonathan Roewen
     [not found]       ` <452DF46C.802@fmf.uni-lj.si>
2006-10-12 14:26         ` Carlos Pita
2006-10-13 11:56       ` Diego Olivier FERNANDEZ PONS
2006-10-13 12:14         ` Gerd Stolpmann
2006-10-13 12:46           ` Diego Olivier FERNANDEZ PONS
2006-10-13 13:01             ` Luc Maranget
2006-10-13 13:15               ` Diego Olivier FERNANDEZ PONS [this message]
2006-10-13 13:15               ` skaller
2006-10-13 13:36                 ` Luc Maranget
2006-10-13 13:53             ` Gerd Stolpmann
2006-10-13 14:16               ` Luc Maranget
2006-10-12  5:19 Carlos Pita
2006-10-12  5:41 ` [Caml-list] " Carlos Pita
2006-10-12  5:49   ` Basile STARYNKEVITCH
2006-10-12  5:53   ` Jonathan Roewen
2006-10-12  6:10     ` Carlos Pita

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061013151508.2ta6v6y5k4sc80co@webmail.etu.upmc.fr \
    --to=diego.fernandez_pons@etu.upmc.fr \
    --cc=caml-list@inria.fr \
    --cc=luc.maranget@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).