Safe Haskell | Safe-Inferred |
---|
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
A ConsumptionProfile
is composed from both a capacity to consume, & an ability to discriminate based on the specific data.
The former is described by consumptionBounds
& the latter by both hasSpecificRequirement
& canConsumeAnything
.
- type AccumulatedConsumptionProfiles = [ConsumptionProfile]
- data ConsumptionProfile = MkConsumptionProfile {}
- zero :: ConsumptionProfile
- accumulateFrom :: ConsumptionProfile -> [ConsumptionProfile] -> AccumulatedConsumptionProfiles
- aggregateFromConcatenation :: [ConsumptionProfile] -> ConsumptionProfile
- (|+|) :: ConsumptionProfile -> ConsumptionProfile -> ConsumptionProfile
- (<>) :: ConsumptionProfile -> ConsumptionProfile -> ConsumptionProfile
- withinConsumptionBounds :: DataLength -> ConsumptionProfile -> Bool
Types
Type-synonyms
type AccumulatedConsumptionProfiles = [ConsumptionProfile]Source
The ConsumptionProfile
s of all the aggregated tails of a list of Consumer
s.
Data-types
data ConsumptionProfile Source
- A
Consumer
is considered to have aConsumptionProfile
composed from both a capacity to consume, & an ability to discriminate. - Whilst
hasSpecificRequirement
&canConsumeAnything
look like opposites, they can assume independent values; the instance can be both, but only be neither when empty.
MkConsumptionProfile | |
|
Constants
zero :: ConsumptionProfileSource
Both minimum & maximum set to zero; which can be used as the initial value when accumulating the sum of a list.
Functions
accumulateFrom :: ConsumptionProfile -> [ConsumptionProfile] -> AccumulatedConsumptionProfilesSource
Accumulate the specified list of ConsumptionProfile
s, from the specified initial value.
aggregateFromConcatenation :: [ConsumptionProfile] -> ConsumptionProfileSource
The aggregate of the specified concatenation of ConsumptionProfile
s.
Operators
(|+|) :: ConsumptionProfile -> ConsumptionProfile -> ConsumptionProfileSource
The net effect of two concatenated ConsumptionProfile
s.
(<>) :: ConsumptionProfile -> ConsumptionProfile -> ConsumptionProfileSource
The net effect of two alternative ConsumptionProfile
s.
Predicates
:: DataLength | The actual quantity of data consumed. |
-> ConsumptionProfile | The bounds within which data-consumption is required to fall. |
-> Bool |
Predicate, which is True
if the specified data-length, falls within the specified ConsumptionBounds
.