-- | Queries the given list of books for books that match the given criteria.
query :: Text -> BookList -> BookList
query q = Set.filter matcher
  where matcher = (||) <$> match . bookTitle
                       <*> match . bookAuthor
        match   = tokenMatch q

-- | Expects exactly one book and throws an error if that is not satisfied.
query :: Text -> BookList -> BookList
query q = Set.filter matcher
  where matcher = (||) <$> match . bookTitle
                       <*> match . bookAuthor
        match   = tokenMatch q

-- | Expects exactly one book and throws an error if that is not satisfied.
query q = Set.filter matcher
  where matcher = (||) <$> match . bookTitle
                       <*> match . bookAuthor
        match   = tokenMatch q

-- | Expects exactly one book and throws an error if that is not satisfied.