Slide 9
Slide 9 text
TypedCoffeeScript:/ؔ
sqrt :: Number * Number -> Float
pow :: (Number, Number) -> Float
{sqrt, pow} = Math
distance :: Point * Point -> Float
distance = (from, to) ->
sqrt pow(from.x - to.x, 2) + pow(from.y - to.y, 2)
console.log distance {x: 0, y: 0}, {x: 3, y: 4} #=> 5