Menu

[Solved]1 Determine Type Values Many Types Polymorphic Need Use Type Variables Describe Type Cat B Q37265047

1.) Determine the type of each of these values. (Many of the types will be polymorphic, that is you need to use type variable
This is in Haskell1.) Determine the type of each of these values. (Many of the types will be polymorphic, that is you need to use type variables to describe the type.) a) Just “cat” b) Nothing c) [Just “dog”, Nothing] d) [Nothing, Nothing] e) Just (Just “cat”) f) Left “car” g) Right (Just “cat” ) h) Right (Left “dog”) i) Right (Left (Right “can”)) j) [(3, Just “dog” ), (1, Nothing)] k) [ (Left “cat”, Just “dog” ) ] 1) (Right “cat”, Nothing) m) [Right “cat”, Left 2.3] n) [Just 2, Just 3.4] o) (Just 2, Just 3.4) p) Just q) Just (+) r) Right tail s) Left head, Right tail] t) (Left head, Right tail) u) Just [] v) Just Nothing w) Just Left Nothing Show transcribed image text 1.) Determine the type of each of these values. (Many of the types will be polymorphic, that is you need to use type variables to describe the type.) a) Just “cat” b) Nothing c) [Just “dog”, Nothing] d) [Nothing, Nothing] e) Just (Just “cat”) f) Left “car” g) Right (Just “cat” ) h) Right (Left “dog”) i) Right (Left (Right “can”)) j) [(3, Just “dog” ), (1, Nothing)] k) [ (Left “cat”, Just “dog” ) ] 1) (Right “cat”, Nothing) m) [Right “cat”, Left 2.3] n) [Just 2, Just 3.4] o) (Just 2, Just 3.4) p) Just q) Just (+) r) Right tail s) Left head, Right tail] t) (Left head, Right tail) u) Just [] v) Just Nothing w) Just Left Nothing

Expert Answer


Answer to 1.) Determine the type of each of these values. (Many of the types will be polymorphic, that is you need to use type var… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *