How do I complete the function below so that it takes a list of all products that
Fantastic news! We've Found the answer you've been seeking!
Question:
How do I complete the function below so that it takes a list of all products that have been ordered, with the total quantity of each.
productQuantities :: [Order] -> [(Product, Double)]
Type definitions:
type Customer = String
type Product = String
An order of some quantity of a product by a customer is described by the type
data Order = Order Customer Product Double deriving (Show)
A delivery to the supplier of some quantity of a product is described by the type
data Delivery = Delivery Product Double deriving (Show)
Related Book For
Management Accounting Information for Decision-Making and Strategy Execution
ISBN: 978-0137024971
6th Edition
Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young
Posted Date: