|Delivery Type||Delivery length / details|
|Lecture||Approximately 20 x 1hr lectures|
|Practical||10 x 1hr practicals|
|Assessment Type||Assessment length / details||Proportion|
|Semester Exam||2 Hours open book exam||70%|
|Semester Assessment||Mid-semester in-class test||30%|
|Supplementary Exam||2 Hours open book exam||100%|
On successful completion of this module students should be able to:
1. Describe and explain the key differences between procedural and functional programming
2. Demonstrate an ability to write small programs in Haskell
3. Demonstrate an understanding of how a compiler evaluates and executes programs
4. Demonstrate the use of key computing concepts such as types and recursion when programming.
The module aims to expose students to a different style of programming. It provides an introduction to programming language theory and what makes programming languages useful. It aims to demonstrate the options open to those who wish to design or use new programming languages.
This module introduces functional programming and contrasts functional programming with imperative/procedural styles of programming. The module uses the pure functional language Haskell, which is a good vehicle for teaching programming concepts such as types, functions, evaluation order, side effects and proof of correctness.
Week 1: Introduction and types: resources, module structure, the programming environments. Basic types (Ints, Floats, Chars, Strings). The interpreter, and the evaluation of simple expressions. Editing, saving and loading code.
Week 2: Language constructs: How we write Haskell programs. Variables, local definitions, functions, choice, etc. Comments. Evaluation of expressions rather than sequencing of instructions.
Week 3: Lists and tuples: The basic data structures. Tuples as "small objects" and as structured types (via type synonyms). The structure of lists. Functions on lists. The use of map/filter etc. rather than looping. List comprehensions.
Week 4: Recursion. Definition, examples, recursive thinking. Comparison to iteration.
Week 5: Higher order functions. Producing functions and consuming/using/applying functions. The types of functions.
Week 6: Data types. Defining new types. Why new data types are useful. The separation of data and functions. Abstraction via data, functions and modules.
Week 7: Mid semester in-class test. Laziness and evaluation order. Halting and efficiency.
Week 8: IO and purity. More on evaluation order. Side effects.
Week 9: Reasoning, proof and testing. Including HUnit and QuickCheck or similar frameworks.
Week 10: Review and revision classes
|Skills Type||Skills details|
|Application of Number||Inherent in subject|
|Improving own Learning and Performance||From feedback (automatic feedback from computer and in-practical feedback from demonstrators)|
|Information Technology||Inherent in subject|
|Personal Development and Career planning|
|Problem solving||Solving design problems|
|Research skills||Using a computer. Searching the language documentation.|
|Subject Specific Skills||Programming skills, debugging skills|
Reading ListGeneral Text
Bird, Richard (c1998.) Introduction to functional programming using Haskell. 2nd ed., [rev.] Pearson Prentice Hall Primo search O'Sullivan, Bryan. (2009.) Real world Haskell /by Bryan O'Sullivan, John Goerzen, and Don Stewart. http://book.realworldhaskell.org/read O'Reilly Thompson, Simon. (2011.) Haskell :the craft of functional programming /Simon Thompson. 3rd ed. Addison-Wesley Primo search Recommended Text
Hutton, Graham (2007 (various p) Programming in Haskell /Graham Hutton. Cambridge University Press Primo search
This module is at CQFW Level 4