Module for function helper functions (Was: darcs patch: Add equating p x y = p x == p y)

Matthew Cox matt at mattcox.ca
Fri Oct 20 08:51:23 EDT 2006


I agree that Data.Function is appropriate. The Data.Foo modules seem to 
follow a common pattern of a value type + some special values (eg: 
empty) and functions to operate on them. const and id are the "special 
values" and the remaining combinators are functions on that type, namely 
functions. I think the name Data.Function also helps underscore that 
these functions treat their argument functions more or less as data.

Henning Thielemann wrote:
> On Fri, 20 Oct 2006, Malcolm Wallace wrote:
>
>   
>> The question is where in the module hierarchy should such a function
>> live?  It does not really belong with Data.List, or indeed any
>> particular data structure module.
>>
>> I would like to propose a new module for functions like this, which are
>> in some sense "purely" functional, that is, they do not involve any data
>> structure at all, just functions.  Other examples would be
>>
>>     const
>>     id
>>     flip
>>     (.)
>>     ($)
>>     ($!)
>>
>> Any suggestions for a good name for such a module?  Data.Function does
>> not sound right to my ears.
>>     
>
> I also like a special module for that. Why not Data.Function?
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
>
>   



More information about the Libraries mailing list