epi-sim-0.7.0: A library for simulating epidemics as birth-death processes.
Copyright(c) 2021 Alexander E. Zarebski
LicenseMIT
MaintainerAlexander E. Zarebski <aezarebski@gmail.com>
Stabilityunstable
Portabilityghc
Safe HaskellNone
LanguageHaskell2010

Epidemic.Types.Population

Description

This module defines some types and functions for working with identifiers, persons, people, and populations.

  • An Identifier is used as a unique label for a Person,
  • a Person is a single individual,
  • a group of People is a collection of persons,
  • and Population is a typeclass for working with people that have some structure.
Synopsis

Documentation

newtype Person Source #

A type to represent a single person in a group of People

Constructors

Person Identifier 

Instances

Instances details
Eq Person Source # 
Instance details

Defined in Epidemic.Types.Population

Methods

(==) :: Person -> Person -> Bool #

(/=) :: Person -> Person -> Bool #

Show Person Source # 
Instance details

Defined in Epidemic.Types.Population

Generic Person Source # 
Instance details

Defined in Epidemic.Types.Population

Associated Types

type Rep Person :: Type -> Type #

Methods

from :: Person -> Rep Person x #

to :: Rep Person x -> Person #

ToJSON Person Source # 
Instance details

Defined in Epidemic.Types.Population

FromJSON Person Source # 
Instance details

Defined in Epidemic.Types.Population

type Rep Person Source # 
Instance details

Defined in Epidemic.Types.Population

type Rep Person = D1 ('MetaData "Person" "Epidemic.Types.Population" "epi-sim-0.7.0-DViI2uXntfg6JZVuToo6fh" 'True) (C1 ('MetaCons "Person" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Identifier)))

newtype People Source #

A type to represent a population.

Constructors

People (Vector Person) 

Instances

Instances details
Eq People Source # 
Instance details

Defined in Epidemic.Types.Population

Methods

(==) :: People -> People -> Bool #

(/=) :: People -> People -> Bool #

Show People Source # 
Instance details

Defined in Epidemic.Types.Population

Generic People Source # 
Instance details

Defined in Epidemic.Types.Population

Associated Types

type Rep People :: Type -> Type #

Methods

from :: People -> Rep People x #

to :: Rep People x -> People #

ToJSON People Source # 
Instance details

Defined in Epidemic.Types.Population

FromJSON People Source # 
Instance details

Defined in Epidemic.Types.Population

type Rep People Source # 
Instance details

Defined in Epidemic.Types.Population

type Rep People = D1 ('MetaData "People" "Epidemic.Types.Population" "epi-sim-0.7.0-DViI2uXntfg6JZVuToo6fh" 'True) (C1 ('MetaCons "People" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector Person))))

class Population a where Source #

Class of types that can represent populations in an epidemic simulation.

newtype Identifier Source #

A type to hold an integer which is unique to each Person.

Constructors

Identifier Integer 

Instances

Instances details
Eq Identifier Source # 
Instance details

Defined in Epidemic.Types.Population

Show Identifier Source # 
Instance details

Defined in Epidemic.Types.Population

Generic Identifier Source # 
Instance details

Defined in Epidemic.Types.Population

Associated Types

type Rep Identifier :: Type -> Type #

ToJSON Identifier Source # 
Instance details

Defined in Epidemic.Types.Population

FromJSON Identifier Source # 
Instance details

Defined in Epidemic.Types.Population

type Rep Identifier Source # 
Instance details

Defined in Epidemic.Types.Population

type Rep Identifier = D1 ('MetaData "Identifier" "Epidemic.Types.Population" "epi-sim-0.7.0-DViI2uXntfg6JZVuToo6fh" 'True) (C1 ('MetaCons "Identifier" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))

asPeople :: [Person] -> People Source #

A list of persons as a people

includesPerson :: People -> Person -> Bool Source #

Predicate for whether a person is one of the people

haveCommonPeople :: People -> People -> Bool Source #

Predicate for whether two sets of people have any members in common.

nullPeople :: People -> Bool Source #

Predicate for whether there are any people

numPeople :: People -> Int Source #

The number of people

addPerson :: Person -> People -> People Source #

Add a person to a group of people

removePerson :: Person -> People -> People Source #

Remove a person from a group of people

personByteString :: Person -> Builder Source #

A bytestring builder for a person