question archive 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) 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 in haskell? productQuantities :: [Order] -> [(Product, Double)] productQuantities orders =
Subject:Computer SciencePrice: Bought3
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)
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 in haskell?
productQuantities :: [Order] -> [(Product, Double)]
productQuantities orders =