

Piping with Swift - mseri
http://www.mseri.me/piping-with-swift/

======
mercurial
I'm a bit torn about normal functions. Traits/typeclasses often make more
sense, but on the other hand, this kind of static monkey-patching makes it
difficult to figure out which trait provides which method when looking at the
code. But without something like the operator proposed here, chaining normal
functions is quite awkward.

------
mpweiher
I don't get it, why do I need the pipe operator for this?

    
    
       #(9 1 2 3 7 5 5 8 4)  unique sorted
       -> ( 1,2,3,4,5,7,8,9)
    

In Objective-Smalltalk ([http://objective.st](http://objective.st)).

Definitions:

    
    
       -unique
       {
           (NSOrderedSet orderedSetWithArray:self) array.
       }
    
       -sort
       {
           self sortedArrayUsingSelector:'compare:'. 
       }
    

Why is it suddenly cool to make things so much more complicated than they need
to be?

