You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extremely hypothetical. Might be unnecessarily complex.
type Circle { radius: Int }
type Triangle { base: Int, height: Int }
type Shape = Circle | Triangle
fn area (shape: Shape): Double =>
match shape {
Circle => math::Circle::PI * (math::pow(shape.radius, 2))
Triangle => 0.5 * shape.base * base.height
}
The text was updated successfully, but these errors were encountered:
Extremely hypothetical. Might be unnecessarily complex.
The text was updated successfully, but these errors were encountered: