Skip to content

Instantly share code, notes, and snippets.

@vgaltes
Created October 30, 2016 10:18
Show Gist options
  • Save vgaltes/38a2509118e0e6bf8b53ea1ad0a80df6 to your computer and use it in GitHub Desktop.
Save vgaltes/38a2509118e0e6bf8b53ea1ad0a80df6 to your computer and use it in GitHub Desktop.
Circle implementation in F#
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