types - F# equivalent of `is` keyword in C#? -


my first f# day. if have this:

let cat = animal() 

now how check @ later stage if cat is animal?

in c#

bool b = cat animal; 

in f#?

@ildjarn deserves credit here answering first, i'm submitting answer here can accepted.

the f# equivalent of c# is keyword :?. example:

let cat = animal() if cat :? animal     printfn "cat animal." else     printfn "cat not animal." 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -