Different styles of pattern matching

For tutorial, the same functionality, different styles of pattern matching.