Should this definition change into this way for passing compilation

Category: visual studio fsharp

Question

Map to new space on Wed, 12 Mar 2014 09:11:17


Goal : let (%2) (Ffunctor(A,fo,fm,_)) (Ffunctor(_,go,gm,D)) =  Ffunctor(A,fo o go,fm o gm,D);

// Original : let f o g = fun x -> g(f(x))

let o f g = fun x -> g(f(x))

let main =
    let f1 x = x + 1
    let g2 x = x + 2
    let g3 = f1 o g2 
    System.Console.Write("")

it can not write in this way
let g3 = f1 o g2 

does it mean that the definition of Ffunctor(A,fo o go,fm o gm,D) in goal
should change to Ffunctor(A,o fo go,o fm gm,D); ?

Early Bird

Replies

Mr. Tines on Wed, 12 Mar 2014 10:28:52


The supplied function composition operator is written `>>` so

let g3 = f1 >> g2 
does what you want.