Python from Wise Guy's Viewpoint

Jesse Tov tov at eecs.harvREMOVEard.edu
Sat Oct 25 16:27:20 EDT 2003


Remi Vanicat <vanicat+invalid at labri.fr>:
> $ ocaml -rectypes
>         Objective Caml version 3.07+2
>  
> # let rec f x = f;;
> val f : 'b -> 'a as 'a = <fun>

Eww.  Something like this would be much nicer:

    f : mu (\'b. 'a -> 'b)

Still, I didn't know Ocaml did that--cool.

Maybe the point here should be we know how to make a type system that
allows that, but typically it's not worth it because we don't need
functions with those types.  (The ML solution--an implicit fix-point in
data constructors--makes it work pretty much wherever I'd care.)
Actually, I'd be interested to see a function that needs a recursive
type that couldn't be trivially rewritten to make it type in ML/Haskell.

Jesse



Jesse
-- 
"A hungry man is not a free man."         --Adlai Stevenson




More information about the Python-list mailing list