module Update where import Prices -- module from last week -- Update the price of a product in a give pricelist -- -- Example: update pricelist "Mango" 199 = -- [("Mango",199),("Water, 2l",199),("Cheese",399),("Bread",150)] -- update :: PriceList -> String -> Cents -> PriceList update prices newProd newPrice = map updateElement prices -- DELETE where -- FOR updateElement (prod, price) | prod == newProd = (prod, newPrice) -- THE | otherwise = (prod, price) -- LECTURE