Quantcast
Channel: Why are OCaml function arguments evaluated right-to-left?
Viewing all articles
Browse latest Browse all 3

Why are OCaml function arguments evaluated right-to-left?

$
0
0

Anyone know the answer to this? I was just reminded in another thread that this order prevents the definition of the (>>) operator, which sequences 2 monadic computations. Instead, we have to use the ugly >>= fun () -> paradigm.

The reason we can’t have (>>) is just that the right hand side (the latter part of the computation) would be evaluated before the left hand side (the former part of the computation). Of course, we can have (<<), but given the way monadic computation is constructed, I don’t think it’s very useful.

Read full topic


Viewing all articles
Browse latest Browse all 3

Trending Articles