import Data.List type PersonId = Integer type PersonName = String type InfectionId = Integer type InfectionName = String -- Do not add, remove or rearrange fields of these data definitions. -- Do not add, remove or rename their constructors. data TerminationType = Recovered | Dead deriving (Eq, Show) data Person = Person PersonId PersonName deriving Show data Infection = Infection InfectionId PersonId InfectionName deriving Show data Termination = Termination InfectionId TerminationType deriving Show type Persons = [Person] type Infections = [Infection] type Terminations = [Termination] -- TODO: Uncomment and implement these functions according to the assignment. -- countOfInfected :: Infections -> InfectionName -> Int -- countOfInfected = undefined -- dead :: Terminations -> [InfectionId] -- dead = undefined -- activeCases :: Infections -> Terminations -> Infections -- activeCases = undefined -- somebodyDied :: Infections -> Terminations -> [InfectionName] -- somebodyDied = undefined -- checkDeaths :: Infections -> Terminations -> Bool -- checkDeaths = undefined -- diseases :: Persons -> Infections -> [(PersonName, [InfectionName])] -- diseases = undefined -- Data from the assignment examples. You can modify them arbitrarily. You -- should test your solution on your own data. pers :: Persons pers = [Person 1 "Augustin" ,Person 2 "Baltazar" ,Person 42 "Ctirad" ,Person 128 "Zdenek" ,Person 5 "Drahoslav" ] infs :: Infections infs = [Infection 2020 1 "COVID" ,Infection 2019 42 "COVID" ,Infection 1 5 "COVID" ,Infection 5 128 "rymicka" ,Infection 3 5 "astma" ,Infection 2 1 "astma" ,Infection 128 5 "zapal plic" ] ters :: Terminations ters = [Termination 2020 Dead ,Termination 2 Recovered ,Termination 2019 Recovered ,Termination 128 Dead ]