hasklepias-core-0.30.3: Domain-aware tools and types for constructing epidemiological cohorts
Copyright(c) TargetRWE 2023
LicenseBSD3
Maintainerbbrown@targetrwe.com ljackman@targetrwe.com dpritchard@targetrwe.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cohort.IndexSet

Description

 
Synopsis

Documentation

data IndexSet b Source #

A type containing a Data.Set.Set of type Interval b, values of which serve as index times when defining cohorts. In cohort terminology, indices are the points in time at which an observational unit can be assessed whether it meets the criteria for inclusion in the cohort. For example, when i is Interval Day, then index events are days.

A reason for using a set as the underlying type is that indices must be unique within a subject. A subject cannot have multiple observational units for a given index.

Construct an IndexSet using toList.

Instances

Instances details
Ord b => IsList (IndexSet b) Source # 
Instance details

Defined in Cohort.IndexSet

Associated Types

type Item (IndexSet b) #

Methods

fromList :: [Item (IndexSet b)] -> IndexSet b #

fromListN :: Int -> [Item (IndexSet b)] -> IndexSet b #

toList :: IndexSet b -> [Item (IndexSet b)] #

(Show b, Ord b) => Show (IndexSet b) Source # 
Instance details

Defined in Cohort.IndexSet

Methods

showsPrec :: Int -> IndexSet b -> ShowS #

show :: IndexSet b -> String #

showList :: [IndexSet b] -> ShowS #

Eq b => Eq (IndexSet b) Source # 
Instance details

Defined in Cohort.IndexSet

Methods

(==) :: IndexSet b -> IndexSet b -> Bool #

(/=) :: IndexSet b -> IndexSet b -> Bool #

type Item (IndexSet b) Source # 
Instance details

Defined in Cohort.IndexSet

type Item (IndexSet b) = Interval b

null :: IndexSet b -> Bool Source #

Specialized Set.null.

foldl' :: (a -> Interval b -> a) -> a -> IndexSet b -> a Source #

Specialized Set.foldl'.

fromList :: IsList l => [Item l] -> l #

The fromList function constructs the structure l from the given list of Item l

toList :: IsList l => l -> [Item l] #

The toList function extracts a list of Item l from the structure l. It should satisfy fromList . toList = id.