TOPICS FOR THE COP 4020 EXAM on Higher-Order Functional Programming $Date: 2013/03/17 18:32:54 $ This exam covers topics from homework 4, including functional programming in Haskell. It is related to all the course objectives but especially to [Concepts] and [UseModels]. REMINDERS The exam will be open book, open notes, but no electronics. If you need electronic material, print it and bring the printout. (Warning: don't expect to learn the material during the exam. A good idea for studying is to condense your notes to a few pages of ready reference materials. We suggest that you memorize the Haskell syntax you'll need.) If you need more space, use the back of a page. Note when you do that on the front. Before you begin, please take a moment to look over the entire test so that you can budget your time. Clarity is important; if your programs are sloppy and hard to read, you may lose some points. Correct syntax also makes a difference for programming questions. Take special care with indentation and capitalization in Haskell. When you write Haskell code on this test, you may use anything we have mentioned in class that is built-in to Haskell. But unless specifically directed, you should not use imperative features (such as the IO type). You are encouraged to define helping functions whenever you wish. Note that if you use functions that are not in the standard Haskell Prelude, then you must write them into your test. (That is, your code may not import modules other than the Prelude.) HINTS If you use functions like filter, map, and foldr whenever possible, then you will have to write less code on the test, which will mean fewer chances for making mistakes and will leave you more time to be careful. READINGS You may want to read a tutorial on Haskell or the Haskell Language Specification. If you have time, see the course web site and also the course syllabus for other readings. TOPICS In the following, I use + to denote relatively more important topics, and - to denote relatively less important topics. Topics marked with ++ are almost certain to be on the exam. All of these are fair game, but if you have limited time, concentrate on the ones that are more important first (and in those, the ones you are most uncertain about). SKILLS [UseModels] ++ Haskell programming; be able to: ++ write functions that work nested, recursive lists, tuples, or records [HW4: applyNeuron, applyNetwork, mapInside] ++ use higher-order functions to implement other funcitons [HW4: use foldr to implement concatMap] ++ write higher-order functions [HW4: toCharFun, composeList] ++ use functions as data [HW4: composeList, Matrix, infinite sets] ++ implement an ADT with functions as part of its representation [HW4: Matrix, MatrixAdd, infinite sets] ++ abstract a programming pattern as a function [HW4: concatMap, foldWindowLayout] TERMS AND CONCEPTS [Concepts] [MapToLanguages] You should be able to explain and use (in problems or essays) the following concepts (with appropriate comparisons to related concepts). You should be able to give examples of these concepts. + Scoping: + Find the free and bound identifiers in an expression - Why is static scoping useful? - How do closures aid in static scoping? + Haskell and declarative model concepts: + Be able to read a data definition in Haskell. + Be able to read and understand type declarations in Haskell. - What is a closure? - What is a curried function? + How does type checking work in Haskell? What do types mean? + Syntactic sugars: - What is a syntactic sugar? Give examples from Haskell. + Type classes and instances: - Be able to write an instance for a given type class - Monads - Be able to read and write monadic code in Haskell