help for excersise 5.13

rock dwan
Wed, 10 Oct 2001 15:45:29 +1300

i have done the function for borrowers but having some trouble with the 
borrowed and numBorrowed function. I have listed my code below with the 
borrowed function not completed and numBorrowed also not completed.Can you 
plz try to fill in the borrowed and numBorrowed functions if you can


type Database = [(Person,Book)]
type Person = String
type Book   = String

exampleBase :: Database

  = [("Alice","Tintin"),("Anna","little 

borrowers :: Database -> Book -> [Person]
borrowers db findBook
= [person|(person,bks)<-db,bks==findBook]

borrowed :: Database -> Book -> Bool
borrowed db bookName

numBorrowed :: Database -> Person -> Int

reference from the craft of func programming second edition book page 84 and 

Get your FREE download of MSN Explorer at