Why does Dynamic Typing really matter?!?

Michael Hudson mwh at python.net
Fri Feb 7 07:25:56 EST 2003


Jp Calderone <exarkun at intarweb.us> writes:

>   Jeremy probably knows better than I, but doesn't Caml support a similar
> system to Haskell's typeclasses?  I forget the name, but something to effect
> of ...
> 
>   type <symbol> =
>     <name0> of <type0>
>   | <name1> of <type1>
>   | ...;
> 
>   Once upon a time, I wrote a serializer in Caml, and I used these to write
> generic functions for groups of types.

The key difference between that and Haskell's typeclasses is that you
list all the possibilities in the declaration, whereas you can add to
a Haskell typeclass in a different module.

As someone else mentioned, Ocaml's modules provide similar
functionality (albeit in a rather different way).

At least, I think so.  Yeech, it's been a while since I did any FP...

Cheers,
M.

-- 
  The Programmer's Quick Guide To Python (Time Machine version):
    You try to shoot yourself in the foot, only to realize that
    there's no need, since Guido thoughtfully shot you in the foot 
    years ago.                     -- Nick Mathewson, comp.lang.python




More information about the Python-list mailing list