module Main where import IO import AddressDB import ADB_UserInterface -- read address data from user and -- insert new entry into address book doInsert:: AddressBook -> IO () doInsert db = do adr <- readAddressDialogue mainLoop (insertAddress db adr) -- read search string from user, search -- address book and display matches doSearch:: AddressBook -> IO () doSearch db = error "doSearch: not yet implemented!" -- read search string from user, search -- address book, display matches. Let user -- choose which of the matches to delete, -- update address book accordingly doDelete:: AddressBook -> IO () doDelete db = error "doDelete: not yet implemented!" -- main mainLoop:: AddressBook -> IO () mainLoop db = do cmd <- mainDialog case cmd of AddEntry -> doInsert db Search -> doSearch db Delete -> doDelete db Quit -> return () startDB:: IO () startDB = mainLoop newAddressBook main:: IO () main = do hSetBuffering stdout NoBuffering startDB