Sergei D. Meshveliani proposes:

> To replace such standard prelude functions as  min,minimum,sort  etc.  
> with their "function-argument" variants.

This has been part of the plan for some time.
The following has an up-to-date description of the proposal.

  http://www.cs.yale.edu/HTML/YALE/CS/haskell/preludechanges.html

See these sections in particular:

* Reorganize the Ord class 
* Non-overloaded versions of PreludeList functions 

The major differences are:

* Sergei proposes this interface

  -- names changed to match 1.3 proposal
  > data Ordering = LT | GT | EQ  
  > minBy :: (a -> a -> Ordering) -> a -> a -> a

  But we plan to use:

    minBy :: (a -> a -> Bool) -> a -> a -> a
    -- first argument is a "less than or equal" comparision

  Our argument for the simpler interface is that:

  * min doesn't need the more complex one
  * it is probably easier to use

  (For the function "sort" it may be worthwhile providing a
  "Sergei-style" interface.)

* Sergei proposes replacing existing functions rather than simply
  supplementing the existing ones.

  Though we agree with Sergei that the Prelude is already too big, we
  rejected this approach because 

> Further, what I fear the most is that the suggestion would be 
> accepted, and these new versions join the old ones !
> For really, the prelude contains to many functions.

I'd agree that it contains too many functions.  However, deleting
existing functions risks breaking code.  I doubt many people would
care is we changed "minimum" and "maximum" (which operate on lists and
fail for empty lists) but breaking code that used "min" or "max" would
probably irritate too many people and they'd go looking for a more
stable language.

Alastair Reid
Yale Haskell Project



Reply via email to