On Mon, 4 Oct 1999, Manuel M. T. Chakravarty wrote:

> Kevin Atkinson <[EMAIL PROTECTED]> wrote,
> 
> > The key word here is excessive.   If you are confusing your self by
> > using the same name for everthing than you need to use seperate function
> > names.  So you are saying that haskell should avoid all featurs that can
> > be abused. 
> 
> Excessive by my definitions if the use of one function name
> for `union' and `unionBy'.  What's the harm in using two
> function names here?  Where overloading makes sense `union'
> uses it already.  If you have to use `unionBy', this is
> because the elements of the set are not part of `Eq' or you
> want to use something else than standard equality.  In other
> words, there is a good reason for using `unionBy' contained
> in the algorithm or at least the structure of your program
> (otherwise, you have probably already made a mistake in your
> class definitions).  As there is such a reason, you should
> document it by using `unionBy' instead of `union' -
> everything else is, frankly speaking, careless software
> engineering.


I am not going to argue with you any more.  We have a different
definitions of what is easy to read.  To me:

  union fun list1 list2

makes perfect sense to me.  To you it may not.  The union and unionBy
is not so much what I object to as having to write two definitions for
union when I should only really have to write one using a generic
comparison function.

Also I hate not being able to have emulations such as

  data Bool = True | False
  data Bool2 = True | False | DontCare

which true adhoc overloading will allow.

Also, sense Haskell does not support objects in the form 
  object->function parms
you have to use
  function object parms

Unfortunately this means that two different objects can not have the same
"method" name unless that method is a type class.  And type classes won't
always work.

Also I hate long complicated system calls with lots of parameters which
you have to explicitly specify in the order given.  True adhoc
overloading will allow me to write an open function such as.

open HANDLE filename ReadOnly
open HANDLE filename Append
open HANDLE filename Write (Overwrite := False)

true adhoc overloading will allow me to do this.

---
Kevin Atkinson
[EMAIL PROTECTED]
http://metalab.unc.edu/kevina/




Reply via email to