D. Tweed  <[EMAIL PROTECTED]>  writes on 1 Jun 2000 

>> We also may paste           
>>                                  True :: Bool  instead of  False
>> (the type design does not help),
>>                                  x / 0      instead of  x / 2,   
>>                                  take n xs  instead of  take (-n) xs
>> We also may forget to write a program and try to use it.

> Do you really believe the general principle that `if something is
> inherently error prone then something is only worth doing if it solves all
> the errors completely, not if it only makes things slightly less error
> prone?' That would suggest that strong typing, haskell style modules and
> numerous other innovations are mistakes made in the language design
> process.

I meant: if 3/4 of errors still remain after the perfect type design,
maybe, the place of this type design is not so important.


>>   data ModeQuotRem = QuotRem_minRem | QuotRem_positive | QuotRem_other
>>                      deriving(Eq,Ord,Enum,Show,Read)
>>                                                           -- contrived
>> 
>>   data Mode_sort = Sort_quick | Sort_merge | Sort_insert | Sort_other 
>>                    deriving(Eq,Ord,Enum,Show,Read)
>>  ...
>> Again, `Positive' would not do, it should be something like  
>> QuotRem_Positive, and so on.

> The only collision here if you remove the QuotRem_ & Sort_ prefixes comes
> from the other, which seems like excess generality to me: do you really
> want an option to use a QuotRem function in a mode about which you know
> nothing. 

By  _other  I meant  _Default.  
For example,  Sort_other  means "sort as you (library) can". 

> If Fergus' suggestion about allowing overloaded data constructors
> for H-2 is allowed then I've no problem with multiple instances of
> Positive 

With the overloaded data constructors, the special data types for 
the Mode may have sense.

> [..]  The problem with chars is if for example `p' means positive 
> (ie >=0) in one function and strictly-positive (ie >0) in another
> [..]

The manual on a Mode is the part of the manual on a function.
See a function, and it shows what the mode values mean.
Like everywhere in the world. 
The mode value names themself are somewhat senseless, they have sense
only inside the manual on the function.

------------------
Sergey Mechveliani
[EMAIL PROTECTED]







Reply via email to