Lab 14: Cleaning Up the Client
In the First 5 Minutes
Please complete this quick survey. None of the instructional staff for the course will see any of the individual responses until after final grades have been submitted.
Back to the Lab
Make sure you follow The Style we use for the {B,I,A}SL{,+} languages in this class.
Open your current ChatRoom implementation from labs 6-8, 10-13. Make sure you’ve completed these labs before you continue with this lab and save/submit your definitions. We will be extending this program in future labs.
Choose the initial Head and Hands, and get started!
Looking Back at Lists
In class you’ve been learning about higher-order operations on lists. You’ve seen examples of filters (removing even numbers from lists of numbers, removing empty strings from lists of words), maps (adding 1 to each number in a list, drawing each ChatClient in the ChatRoom), and foldrs (getting the sum or product of numbers in a list, turning a list of characters into a list of words).
Ex 1: Looking back over the exercises you’ve completed in labs (since Lab 9: Lists (& Lists (& Lists))), list 3 functions that you’ve designed that can be classified as filters, 3 as maps, and 3 as foldrs. Write your answers in a comment, then discuss with another pair in your lab to see if your answers agree.
Ex 2: Rewrite any functions you’ve found in your ChatRoom implementation that can be expressed as filters or maps as a filter or a map.
Ex 3: Rewrite any functions you’ve found in your ChatRoom implementation that cannot be expressed as filters or maps, but can be expressed as a foldr as a foldr. What is the key difference between these operations and those that can be expressed as filters or maps?