For most students, labs will be held in rooms on campus. However some students will be taking them online for various reasons. Please see our guide to online labs to find out how to participate in this way.
Labs are where you will work on practical programming skills, under the guidance of experienced tutors.
Read the tasks for the week before you attend the labs, and make a plan on how to approach and solve the tasks ahead of time. The tutors will be are there to help and give you feedback for your ideas (not to do the job for you).
The lab documents are finalised by close of business Friday in the week before the lab—otherwise they are just a sneak preview (and can still change).
Acknowledgements
Material in these labs has been developed over many years by the COMP1100/1130 course staff. Contributors include Debashish Chakraborty, David Quarel, Joshua Corner, Ranald Clouston, Uwe Zimmer, James Barker, Clem Baker-Finch, Tony Hosking, Ekaterina Lebedeva, plus many others. Copyright © 2021 The Australian National University, All Rights Reserved.
Schedule and Tutors
Please only email your tutor for non-general or personal questions
that cannot be posted on Piazza. You must
include the course code (e.g., COMP1100) in the subject of the
email along with a useful title, e.g., COMP1100 - Lab 1 Mark missing
Week 0: Before you start
It is essential that you use StReaMS to enroll in a lab session before Week 1 (this will be available from Week 0).
Week 1: ANU environment, Linux, Haskell
Welcome to COMP1100/1130. For most students, labs will be held in rooms on campus. However some students will be taking them online for various reasons. If you are attending online labs please, see our Setup for Online Labs at the bottom of this lab and our guide to online labs to find out how to participate in this way.
Week 2: Gitlab, VSCode and More Haskell
This week’s lab will introduce you to more important parts of the computing environment of this course, particularly Gitlab, which will be used every time you submit work. We will then further introduce you to programming with Haskell.
Week 3: Algebraic Data Types, Pattern matching, and Guards
In this lab we will look at algebraic data types, pattern matching with the case
command, and guarded expressions.
Week 4: Cabal and CodeWorld
In this lab, we will meet the Cabal package manager, which helps us work on
projects with dependencies between multiple files. We will then program with the
codeworld-api
library, which provides us with types and functions for
drawing and transforming various shapes.
Week 5: Recursion and Lists
In this lab we learn about the concept of recursion, which gives us the ability to “loop”, or repeat the same instruction many times over. We also investigate our first recursive data type, lists, that can pack many instances of a type together. We will write recursive functions over integers and lists.
Week 6: More Lists, Parametric polymorphism, Recursive Data Types
This lab covers more recursive functions over lists, the concept of parametric polymorphism, and how it can be used to write functions that operate on more general types than before. We will see some examples of custom recursive data types, and how to write recursive functions over them.
Week 7: Style and Testing
This lab covers two aspects of code quality: style, which is the way to write readable code; and verifying correctness via testing.
Week 8: Higher Order Functions
In this lab we cover higher order functions - particulary, functions that can take other functions as input. These can be used to avoid rewriting common code patterns, and generalise many patterns of recursion that we’ve already seen.
Week 9: Trees
In this lab we cover the concept of trees, how they differ to lists, and how we can write recursive functions that operate on trees.
Week 10: Type Classes, Ad Hoc Polymorphism, Binary Search Trees
In this lab, we cover type classes and ad hoc polymorphism, and how we can use these concepts to generalise functions that require some assumptions about the input type. We also continue the topic of trees from last lab, and introduce binary search trees, which are trees with a special ordering constraint that gives them a great advantage over binary trees in terms of computational efficiency.
Week 11: Complexity
In this lab we discuss the topic of algorithmic complexity is, and learn how to determine the complexity of a particular algorithm. We also learn how to use big-O notation to describe complexity.
Week 12: Exam Prep
In this lab we recap the course, and provide lots of exercises for you to work on with your peers to help prepare for the final exam.