Skip to content

Instantly share code, notes, and snippets.

Created May 12, 2015
What would you like to do?
type Duck () =
member this.sayQuack = printfn "quack, quack..."
type Bird () =
member this.sayQuack = printfn "tweet, tweet..."
type Dog () =
member this.bark = printfn "woof, woof..."
let duck = Duck()
let bird = Bird()
let dog = Dog()
// dog.sayQuack (* VS would underline error in red: 'sayQuack' is not defined. *)
(* output:
quack, quack...
tweet, tweet...
woof, woof...
val it : unit = ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment