Skip to content

Instantly share code, notes, and snippets.

@khalidabuhakmeh
Created June 18, 2013 15:03
Show Gist options
  • Select an option

  • Save khalidabuhakmeh/5806116 to your computer and use it in GitHub Desktop.

Select an option

Save khalidabuhakmeh/5806116 to your computer and use it in GitHub Desktop.
Real World Functional Programming Hello World.
open System.Drawing
open System.Windows.Forms
type HelloWindow() =
let frm = new Form(Width = 400, Height = 140)
let fnt = new Font("Time New Roman", 28.0f)
let lbl = new Label(Dock = DockStyle.Fill, Font = fnt, TextAlign = ContentAlignment.MiddleCenter)
do frm.Controls.Add(lbl)
member x.SayHello(name) =
let msg = "Hello " + name + "!"
lbl.Text <- msg
member x.Run() =
frm.ShowDialog()
let hello = new HelloWindow()
hello.SayHello("Khalid Abuhakmeh")
hello.Run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment