// @(#)$Id: LibraryDBProblem.scala,v 1.2 2005/11/01 20:21:54 leavens Exp leavens $
package scalahw;
trait LibraryDBProblem {
  type Person = String;
  type Book = String;
  type Database = List[Pair[Person, Book]];
  
  /** "Given a book, find the borrower(s) of the book, if any." */
  def borrowers (db: Database)(bk: Book): List[Person];
  
  /** "Given a book, find out whether it is borrowed." */
  def borrowed (db: Database) : Book => Boolean;

  /** "Given a person, find out the number of books he or she has borrowed." */
  def numBorrowed (db: Database)(per: Person): Int;
}
