type Name = String type Pnum = Integer type Pbok = Name -> Maybe Pnum lookup' :: Pbook -> Name -> Maybe Pnum lookup' f x = f x insert :: Pbook -> Name -> Pnum -> Pbook insert pb x n = if (length . show) n /= 8 then error "Expected phone number with 8 digits." else (\z -> if z == x then Just n else Nothing) delete :: Pbook -> Name -> Pbook delete f x = (\x -> Nothing)

The problem is that I know how to pass around the phone book that contains the names. Any help is appreciated!