book's example of the lazy implement of ex3.24's hasSubsequence using functions defined in ch5