No history yet

Final Exam

 

1.What is the primary consequence of Haskell's lazy evaluation strategy?

 

2.Given the function add :: Int -> Int -> Int, the expression add 5 is a:

 

3.The data type data Point a = Point a a is an example of a:

 

4.Pattern matching in Haskell is a form of structural decomposition. True or False?

 

5.A type class is analogous to an 'interface' in languages like Java or a 'protocol' in Swift. However, a key difference in Haskell is that:

 

6.What is the primary role of the Functor type class?

 

7.The Applicative type class is a generalization of Functor and a specialization of Monad. Its unique power, compared to Functor, comes from:

 

8.In Haskell's do-notation, what is the <- operator syntactic sugar for?

 

9.The IO monad achieves referential transparency in a language that performs real-world side effects by:

 

10.The State monad is used to simulate mutable state in a pure functional setting. How does it work?

 

11.A developer needs to build a computation that requires read-only configuration, can fail with an error message, and performs IO actions. What is the most idiomatic way to combine these effects in Haskell?

 

12.Generalized Algebraic Data Types (GADTs) extend ADTs by allowing:

All done? Get your grade