Flipped function application

Wvv vitea3v
Wed Oct 9 21:53:12 UTC 2013


Because we are talking about 2 lines of code (15 non-space symbols) outside
of the core, the question is a bit different: do you want to guide the
process, or do you prefer to see how this process become completely
non-controllable? 

I really-really don't understand when at some languages people say "It's
nice language, but don't use build lib, use extension/battery lib".
Sometimes it became even dramatic, like D language, when extended library
(Tango) was incompatible (at D1 times) with the standard one. 

This is looks like OCaml has neither (.), nor ($). Fortunately,
OCaml-Batteries add :

val (|>) : 'a -> ('a -> 'b) -> 'b
val (<|) : ('a -> 'b) -> 'a -> 'b
val (|-) : ('a -> 'b) -> ('b -> 'c) -> 'a -> 'c
val (-|) : ('a -> 'b) -> ('c -> 'a) -> 'c -> 'b
val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c
val curry : ('a * 'b -> 'c) -> 'a -> 'b -> 'c
val uncurry : ('a -> 'b -> 'c) -> 'a * 'b -> 'c
val const : 'a -> 'b -> 'a

I don't want Haskell be like OCaml and use Data.Lens/other package for using
simplest (&/#/<:/|>/..) function!



Niklas Haas wrote
> On Wed, 9 Oct 2013 11:51:39 -0700 (PDT), Wvv <

> vitea3v@

> > wrote:
>> It's looking very strange, that such easy function as flipped function
>> application is still absent at the base.
> 
> I'm not convinced the stylistic differences to ($) are really worth
> adding it as a distinct combinator, at least for general-purpose code.
> 
> It works nicely for lens because it lets you mimic the appearance of
> record update syntax, but it might not be the best idea to introduce it
> as an entirely separate idiom - seeing as it could cause lots of
> unnecessary code complexity and confusion.
> _______________________________________________
> Libraries mailing list

> Libraries@

> http://www.haskell.org/mailman/listinfo/libraries





--
View this message in context: http://haskell.1045720.n5.nabble.com/Flipped-function-application-tp5738131p5738150.html
Sent from the Haskell - Libraries mailing list archive at Nabble.com.




More information about the Libraries mailing list