CSCI 360 - Survey of Programming Languages

Fall 2014

Paper 3: Haskell

Write a 2-3 page paper in which you answer one of the following questions:
  1. The expression problem is concerned with two alternatives that arise when statically defining polymorphic data types. Each "easy" variation can be performed in a new source file; each "hard" variation requires modifying the source file containing the type definition. Adding new subtypes is easy in an object-oriented language; adding new methods is hard. Adding new functions is easy in a statically-typed functional language, but adding new subtypes is hard. Based on at least one non-trivial project you have completed, assess the degree to which you consider the first or second approach to be the more significant problem. Use specific examples from your project to support your argument.
  2. An arguable advantage of dynamically-typed languages is that polymorphism is straightforward to implement. An advantage of statically-typed languages is that many run-time errors in dynamically-typed languages are caught at compile-time. There is a trade-off, though; as Haskell demonstrates, polymorphic static type checking can result in a very complex type system. Assess the trade-off among safety, complexity, and flexibility between the type systems of Haskell and your choice from Smalltalk, Python, and Racket.