Yes, I said that it's *like *function composition in reverse order. And
only if you apply the function returned by comp, as I did in my example.
It's not to be taken too literally, but it is perhaps helpful for people
coming from language that have function composition but no analogue to ->.
On
On Sun, Apr 14, 2013 at 1:03 PM, Marko Topolnik wrote:
> On Sunday, April 14, 2013 7:51:10 PM UTC+2, Matthew Hill wrote:
>
>> Function composition is done via comp. Using -> and ->> is like function
>> composition in reverse order (though there's a difference between how the
>> two thread return v
On Sunday, April 14, 2013 7:51:10 PM UTC+2, Matthew Hill wrote:
> Function composition is done via comp. Using -> and ->> is like function
> composition in reverse order (though there's a difference between how the
> two thread return values), and often it reads more naturally.
-> applies the
Function composition is done via comp. Using -> and ->> is like function
composition in reverse order (though there's a difference between how the
two thread return values), and often it reads more naturally.
user> (-> [1 2 5] rest first)
2
user> ((comp first rest) [1 2 5])
2
On Wednesday, 3 Ap
Isn't the dot just like Clojure's *comp*? As Allan correctly points out,
the thrushes are macros that combine the given forms in a specified way,
which only under certain constraints has the effect of composing function
applications, whereas *comp* is truly a function composition operator.
On T
if you come from the haskell world, it is like . piplining - but in reverse
order
I needed some time to get used to it but I really like -> ->> as-> ... to
structure my code.
It helps to see the sequence of functions that operate on your data
On Wed, Apr 3, 2013 at 11:05 PM, Alan Malloy wrote:
Not even that: -> is not a function composition operator at all, but a
form-rewriting macro. You can perfectly well write (-> [x xs] (for (inc
x))) to get (for [x xs] (inc x)), and that is not composing any functions.
The two things are entirely separate.
On Wednesday, April 3, 2013 12:45:55 PM
Now it's clear.
Thank you
Plínio
On Wed, Apr 3, 2013 at 4:45 PM, Marko Topolnik wrote:
> I guess you mean the monadic bind operation, but -> is not it. The only
> conceptual connection between *bind* and -> is that they are both some
> kind of function composition operators.
>
> -marko
>
>
> O
I guess you mean the monadic bind operation, but -> is not it. The only
conceptual connection between *bind* and -> is that they are both some kind
of function composition operators.
-marko
On Wednesday, April 3, 2013 8:21:43 PM UTC+2, Plinio Balduino wrote:
>
> Hi there
>
> Is it correct to sa
Hi there
Is it correct to say that -> operator is a kind of monad in Clojure?
Thank you in advance.
Plínio Balduino
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts fr
10 matches
Mail list logo