Question: Below are several type definitions. You do not need to know any of the implementations or type definitions that are omitted in order to solve

 Below are several type definitions. You do not need to know

Below are several type definitions. You do not need to know any of the implementations or type definitions that are omitted in order to solve the problems. You should assume that all of the undefined types are unique data types (that is, they're not just type synonyms of Int or Float). data Shape = Circle Radius | Rectangle Length Width | Scale Float shape one :: Radius two :: Length three :: Width pi :: Float origin :: Position area :: Shape -> Float draw :: Position -> Shape -> HTML flip :: (a -> b -> c) -> b -> a -> C :: (b-> C) -> (a - b) -> a -> C (.) For each of the following problems, write the type of the expression in the blank provided, or write "type error" if the expression is not type correct. 1. Scale (area (Circle one)) (Rectangle two three) Type: : 2. area Rectangle two three Type: 3. flip Rectangle three two Type: 4. flip draw (Rectangle two three) Type: 5. draw origin . Scale pi Type

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!