English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Same label in different types, how do people solve this?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-12-12 (09:27)
From: Chet Murthy <chet@w...>
Subject: Re: Same label in different types, how do people solve this?

The issue, about practicality, isn't whether you _can_ specify the
particular types and type-usages you want.  The issue is whether, if
you write a phrase, and you got it wrong, you have to know all about
the type system, in order to debug that phrase.

In SML, you have to understand the type algorithm enough to identify
when you've underspecified a type, and that can be _tricky_.

In CAML, you either got it right, or got it wrong.

That simplicity goes a long way.  And without it, well, you've got to
teach the world all the intricacies of polymorphic typing.

Not a winning strategy.


>>>>> "CH" == Chris Hecker <checker@d6.com> writes:

    >> I understand that all you functional experts thinks this
    >> restriction is obvious, but for me it is more like a
    >> bug/misfeature. So this 'misfeature' should actually be stated
    >> for all us who aren't interested how types are infered in
    >> functional programming.

    CH> I'm with Mattias on this one.  I'm practical above
    CH> theoretical.  All of the workarounds for this problem seem
    CH> like they generate way more tedious work for the programmer,
    CH> and they still don't quite accomplish the goal 100%.  This
    CH> characteristic of doing more work and only asymptotically
    CH> approaching your goal is a bad taste I associate with C++.

    CH> Anyway, my "vote" would be to allow specification, with : if
    CH> it's possible since it's the obvious syntax, but even with @@
    CH> if necessary (even though I think it's really ugly).