Created
June 18, 2013 15:03
-
-
Save khalidabuhakmeh/5806116 to your computer and use it in GitHub Desktop.
Real World Functional Programming Hello World.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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