CIS 552: Advanced Programming

Fall 2017

  • Home
  • Schedule
  • Homework
  • Resources
  • Style guide
  • Syllabus
Note: this is the stubbed version of module Queue. You should download the lhs version of this module and replace all parts marked undefined. Eventually, the complete version will be made available.

Exercise: Purely Functional Queues

> {-# LANGUAGE ScopedTypeVariables, TypeApplications, AllowAmbiguousTypes #-}
> 
> {-# OPTIONS_GHC -fdefer-type-errors #-}
> module Queue where
> import Test.QuickCheck
  1. Define an interface for a purely functional Queue (FIFO) using a type class. It must (at least) have a way to add an element to the end of the queue (enqueue) and remove the element at the beginning of the queue (dequeue).
  1. Define some properties that your queue should satisfy.
  1. Implement your interface.
  1. Make an arbitrary instance.
  1. Run your tests.
Design adapted from Minimalistic Design | Powered by Pandoc and Hakyll