Created
October 30, 2016 10:18
-
-
Save vgaltes/38a2509118e0e6bf8b53ea1ad0a80df6 to your computer and use it in GitHub Desktop.
Circle implementation in F#
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
type Circle = {x: double;y: double;radius: double} with | |
member this.Area = Math.PI * this.radius | |
let mc = {x = 2.0; y = 3.0; radius = 5.0} | |
printfn "area: %f" mc.Area | |
printfn "x: %f" mc.x | |
printfn "y: %f" mc.y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment