Implements Assignment 4 Part 2-3

Singleton

Uses pattern matching, but could be implemented using length
Merge pull request #5 from jackcviers/singleton

Implements Assignment 4 Part 2-3