-- | Just providing some simple functions to be used as SUTs module CTy.Example0 where data InsuranceType = Standard | Comfort | Super deriving (Eq,Show) calcPremium insType age city = if age <= smallkidUpperAge then kidPrem else if age <= bigKidUpperAge then 0.5 * premium else premium where smallkidUpperAge = 7 bigKidUpperAge = 16 kidPrem = 200.0 premium = (1 + cityModifier) * basePrem cities1 = ["Amsterdam","Rotterdam"] cities2 = ["Utrecht","Eindhoven"] city1Mod = 0.1 city2Mod = 0.05 cityModifier = if insType==Super then 0 else if city `elem` cities1 then city1Mod else if city `elem` cities2 then city2Mod else 0 basePrem = f insType where f Standard = 500.0 f Comfort = 700.0 f Super = 1000.0