> On Sun 03 Oct, Manuel M. T. Chakravarty wrote: 
> The problem with excessive overloading is that
> 
> (1) it is often cute in small programs, but bites you when
>     software gets more complex, and
> (2) it makes it harder for beginners.

I can think of 2 more potential problems with overloading (ad-hoc or otherwise)

(3) It makes it hard to use Haskell as a target language for other
    software tools, synthesizers etc unless they adopt essentially the
    same type system as Haskell. It would be much easier, I think, if
    the 'operational meaning' of a bit of Haskell code is unambiguous
    without type checking. By this I mean you could turn type checking
    off and still be able to compile the program.

(4) If you have 2 different methods to achieve the same thing (e.g.
    2 different algorithms which are the most efficient in different
    circumstances, or 2 criteria for comparing values of the same type).
    Here you can't use type to select the appropriate method. Instead
    you have to make values of the 'same type' look different just so
    the correct method can be chosen, which complicates matters a lot.
    Giving different names to different functions seems much easier to me.

Regards
-- 
Adrian Hey




Reply via email to