News for hackers. Stuff that matters.
Re:F# 4.0 Preview by louthy on Thursday November 13, 2014 @07:54AM (#8601248)
Your F# example can be more concise:

    type Shape =
        | Circle of float
        | Square of float

    let area = function 
        | Circle r -> Math.PI * r * r
        | Square sd -> sd * sd

    let perimeter = function 
        | Circle r -> 2.0 * Math.PI * r
        | Square sd -> sd * 4.0
Re:F# 4.0 Preview by noblethrasher on Thursday November 13, 2014 @10:57AM (#8602173)
Well, that's just... neat.