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

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -