Proposal: Add (&) to Data.Function
apfelmus at quantentunnel.de
Fri Nov 23 12:34:23 CET 2012
Johan Tibell wrote:
> On Thursday, November 22, 2012, Joachim Breitner wrote:
>> -1 for adding such an operator at all. Languages benefit from consistnet
>> idiom; too many ways of doing the same thing are not always good.
> -1 for me for the same reason. After looking at examples in this thread I
> don't find that the loss in readability is worth it.
> Also for beginners I don't want to explain yet another way to write
> function application.
-1 from me as well.
The (#) operator is quite natural and useful in the diagrams library,
but the thing is that even though it is *implemented* as function
application, it is *semantically* not a function application. It only
serves to furnish shapes and diagrams with additional properties; it's
type is very restricted, so to speak.
Since the use cases mentioned (diagrams, lenses) are very similar,
perhaps there is a general combinator (&) that does the job for both,
but which has a much more restricted type and is not equivalent to
reverse function application. Maybe an abstraction like "Settable
functors", "Thingomorphisms with properties" or something like that.
More information about the Libraries