-- This is a source code template for Curry programs. data Point = Point {x :: Float, y :: Float} data Shape = Circle {radius :: Float, pos :: Point} | Rectangle {top_left :: Point, bot_right :: Point} | Triangle {pointA :: Point, pointB :: Point, pointC :: Point} find_area :: Shape -> Float find_area (Circle r _ ) = 3.14 * r * r find_area (Rectangle (Point x1 y1) (Point x2 y2)) = abs(y2 - y1) * abs(x2 - x1) find_area (Triangle (Point x1 y1) (Point x2 y2) (Point x3 y3)) = 0.5 * (x1 * abs(y2 - y3) + x2 * abs(y3 - y1) + x3 * abs(y1 - y2)) myCircle = Circle { radius = 10, pos = (Point 0 0) } mySquare = Rectangle {top_left = (Point 0 0), bot_right = (Point 10 10)} myTriangle = Triangle (Point 0 0) (Point 3 3) (Point 3 0) rad = find_area myTriangle rad = find_area myCircle rad = find_area mySquare main = rad -- put here the main expression of your program