14.5 - isRound (Triangle _ _ _) = False area :: Shape...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
--14.5 data Shape = Circle Float | Rectangle Float Float | Triangle Float Float Float perimeter :: Shape -> Float perimeter (Triangle x y z) = x+y+z isRound :: Shape -> Bool
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: isRound (Triangle _ _ _) = False area :: Shape -> Float area (Triangle x y z) = sqrt(s*(s-x)*(s-y)*(s-z)) where s = perimeter (Triangle x y z) / 2...
View Full Document

Ask a homework question - tutors are online