proposal #3335: make some Applicative functions into methods, and split off Data.Functor

Ross Paterson ross at soi.city.ac.uk
Tue Jun 30 11:12:21 EDT 2009


On Tue, Jun 30, 2009 at 01:37:05PM +0200, Henning Thielemann wrote:
> This sounds like a rather ad-hoc extension of the already complicated  
> hierarchy of those category classes. Are there particular examples where  
> the specialisation is needed and where it cannot be done by optimizer  
> rules?

Here's one for (<$).  In Data.Sequence, I could define

  x <$ s = replicate (size s) x

(using Louis Wasserman's replicate), which would take O(log n) time and
space, a big improvement over the O(n) version using const and fmap.


More information about the Libraries mailing list