Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,8 @@
type Shape =
abstract Perimeter: unit -> float
abstract Area: unit -> float
type Rectangle(width, height) =
interface Shape with
member x.Perimeter() = 2.0 * width + 2.0 * height
member x.Area() = width * height

View file

@ -0,0 +1,16 @@
[<AbstractClass>]
type Bird() =
// an abstract (=virtual) method with default impl.
abstract Move : unit -> unit
default x.Move() = printfn "flying"
// a pure virtual method
abstract Sing: unit -> string
type Blackbird() =
inherit Bird()
override x.Sing() = "tra-la-la"
type Ostrich() =
inherit Bird()
override x.Move() = printfn "walking"
override x.Sing() = "hiss hiss!"