Jul 8, 2011

f# essential - part 11 - ignore function

If you call a function which does not return unit type, you can not call it like the following.

let f1() = 
    //do some side effect stuff

You have to do the following

f1() |> ignore
let _ = f1()

No comments:

Post a Comment