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

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -