1 definition module cashModel
3 Pieter Koopman, Radboud University, 2017 -2018
7 A simple state model for an automated cash register
10 import StdEnv, Data.GenEq
12 :: Euro = {euro :: Int, cent :: Int}
13 :: Product = Pizza | Beer | Cola
14 :: Action = Add Product | Rem Product | Pay
16 class euro a :: a -> Euro
17 instance euro Product, Euro
18 instance euro Int, (Int, Int), [e] | euro e
24 instance == Euro, Product
26 model :: [Product] Action -> ([Product],[Euro])