The general null statement in F# is (), of type unit, eg.

1
if true then printfn "true" else ();;

Your exception example would be:

1
2
3
4
5
6
let foo() =
    try
        printfn "foo"
        raise (System.Exception("gotcha"))
    with
    | _ -> ()  // Note that _ matches all cases. No need for an identifier.

> foo();;
foo
val it : unit = ()

By on 12/29/2009 4:46 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper