AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- Define the requirements & capabilities of a data-type which is designed to consume data.
- This module also facilitates investigation of group-behaviour, by defining operations on either concatenations or alternations of
Consumer
s. - This module is specifically for use in a regex-engine, in which the meta-data from which the regex is composed, are considered to consume input data, whilst concatenation & alternation of such elements, behave as a different types of groups of consumer.
- class Consumer c where
- consumptionProfile :: c -> ConsumptionProfile
- starHeight :: c -> StarHeight
- accumulateConsumptionProfiles :: Consumer c => [c] -> AccumulatedConsumptionProfiles
- aggregateConsumptionProfilesFromAlternatives :: Consumer c => [c] -> ConsumptionProfile
- aggregateConsumptionProfilesFromConcatenation :: Consumer c => [c] -> ConsumptionProfile
- getConsumptionBounds :: Consumer c => c -> ConsumptionBounds
- getFewest :: Consumer c => c -> DataLength
- getHasSpecificRequirement :: Consumer c => c -> Bool
Type-classes
- The interface, to which types, which have a data-requirement, may conform.
- Regrettably, methods requiring reference to the type of the consumable, would require multi-parameter type-classes.
-
consumptionProfile
defines the quantity-range of data which may be consumed, & any specific data-requirements. -
starHeight
measures the complexity of theConsumer
.
consumptionProfile :: c -> ConsumptionProfileSource
starHeight :: c -> StarHeightSource
Consumer c => Consumer [c] | |
Consumer a => Consumer (Repeatable a) | |
Consumer (Meta m) | |
Consumer (ExtendedRegEx m) | |
Consumer (Pattern m) | |
Consumer (Alternatives m) |
Types
Type-synonyms
Functions
accumulateConsumptionProfiles :: Consumer c => [c] -> AccumulatedConsumptionProfilesSource
Get the ConsumptionProfile
for the specified list of Consumer
s, then accumulate them.
aggregateConsumptionProfilesFromAlternatives :: Consumer c => [c] -> ConsumptionProfileSource
The aggregate of the specified alternation of ConsumptionProfile
s.
aggregateConsumptionProfilesFromConcatenation :: Consumer c => [c] -> ConsumptionProfileSource
Get the ConsumptionProfile
s for the specified list of Consumer
s, then find the net effect of concatenating them.
Query
getConsumptionBounds :: Consumer c => c -> ConsumptionBoundsSource
Convenience-function, to query the ConsumptionBounds
of a Consumer
.
getFewest :: Consumer c => c -> DataLengthSource
Determine the minimum acceptable quantity of data.
getHasSpecificRequirement :: Consumer c => c -> BoolSource
Determine whether the specified Consumer
, has a specific requirement.