Working in F# has lead me to learn about Haskell. I’m currently on chapter 7 of this tutorial which I HIGHLY recommend.
Quick question though. Maybe I’m getting ahead of myself and I’ll find the answer in future chapters but, is there a way to reverse the position of the function and it’s arguments if the function only takes one argument like in F#.
So, for example, in F# if you had a function called digitToInt (as you do in Haskell), you could do the following:
3 |> digitToInt
I know about using back ticks, but that’s specifically for binary functions. Is there anything similar for unary functions?
One way to do that could be defining an infix function
(|>)that take a value and a function and calls the function passing it the value like this:Then you can use it exactly like in your example: