HASKELL CODING
The exercises are commented out with explanations
7type BarCode Int 8 type Price type Name String Int 1 type Pricelist [(Barcode, Name, Price)] 3 database PriceList 4 database (1848, "Vanilla yogurt cups (4)", 188), 316), 299), 307), 825) 788), 13949), 334), (1620, "Ground turkey (1 lb)", (1492, "Corn flakes cereal", (1773, "Black tea bags (1e0)", (2525, "Atletic socks (6)", (9595, "Claw hamner". (1945, "32-in TV", (1066, "Zero sugar cola (12)". (2818, "Haskell programming book". 4495) 5 17 18 19 20 21 23 25 type CartItems[BarCode] 26 type CartPrices I(Name,Price)] 28 30 29 Excersices 32list of barcodes of the items in a shopping cart and 36 type Bill (CartPrices, Price, Price, Price) 40 9. Takes the list of item prices and contructs a Bill tuple -- 8. Takes a database of product prices (price list) and a 33generates the list of item prices 4 priceCart:: Pricelist -> cartItems -> Cartprices 37 38 39 In carrying out this calculation, the function uses the following n constant: 41- 42 makeBill:: CartPrices BiLL 43 45 taxRate:: Double 46 taxRate=0.07 47 48 49 formatBill:: Bill - String 50 -- converti it ot a printable receipt 7type BarCode Int 8 type Price type Name String Int 1 type Pricelist [(Barcode, Name, Price)] 3 database PriceList 4 database (1848, "Vanilla yogurt cups (4)", 188), 316), 299), 307), 825) 788), 13949), 334), (1620, "Ground turkey (1 lb)", (1492, "Corn flakes cereal", (1773, "Black tea bags (1e0)", (2525, "Atletic socks (6)", (9595, "Claw hamner". (1945, "32-in TV", (1066, "Zero sugar cola (12)". (2818, "Haskell programming book". 4495) 5 17 18 19 20 21 23 25 type CartItems[BarCode] 26 type CartPrices I(Name,Price)] 28 30 29 Excersices 32list of barcodes of the items in a shopping cart and 36 type Bill (CartPrices, Price, Price, Price) 40 9. Takes the list of item prices and contructs a Bill tuple -- 8. Takes a database of product prices (price list) and a 33generates the list of item prices 4 priceCart:: Pricelist -> cartItems -> Cartprices 37 38 39 In carrying out this calculation, the function uses the following n constant: 41- 42 makeBill:: CartPrices BiLL 43 45 taxRate:: Double 46 taxRate=0.07 47 48 49 formatBill:: Bill - String 50 -- converti it ot a printable receipt