Derp.

]]>For the +, – and other operators in F# there are two things:

You can simply use it like in a + b, in this case, it is infixed, and you have to provide both operands.

When using it between parentheses, it becomes a simple function, hence prefixed and curryable.

You can define almost any operator like ??, |?, , +-, ~> by defining it between () like I did for ??.

]]>Amazing how I can now read F# and know what its doing, functional FTW! SICP is opening my eyes a lot!

BTW how did you post code in disqus like that?

]]>let (++) a b = (if a > 0 then (+) else (-)) a b

You can then use the infix operator ++ :

3 ++ -5

or : if you want an operator for if then else :

let (!?) x f e = if x then f else e

let (++) a b = (!? (b > 0) (+) (-)) a b

Have F#un !

]]>cond ? then : else

I know in lisp that you have to be careful because the (if predicate then else) acts as a special construct that behaves slightly differently.

I like this method I want to see what will happen if you turned that into some kind of recursive function. Something really contrived like adding the numbers by incrementing a while decrementing b

]]>(Func) (x,y) => x + y

Kind of interesting actually

]]>https://gist.github.com/1336143 ]]>