interval-1.20160821: Intervals with adherences.

Safe HaskellSafe
LanguageHaskell98

Data.Interval.Sieve

Contents

Synopsis

Type Sieve

newtype Sieve x Source #

..<<..-ordered union of Intervals.

Ressources:

Constructors

Sieve 

Fields

Instances

(Ord x, Show x) => Show (Pretty (Sieve x)) Source # 

Methods

showsPrec :: Int -> Pretty (Sieve x) -> ShowS #

show :: Pretty (Sieve x) -> String #

showList :: [Pretty (Sieve x)] -> ShowS #

fmap_interval :: (Ord x, Ord y) => (Interval x -> Interval y) -> Sieve x -> Sieve y Source #

Like fmap but working on Intervals.

fmap_interval_unsafe :: Ord x => (Interval x -> Interval x) -> Sieve x -> Sieve x Source #

Like fmap but working on Intervals, and safe only if Measure is preserved.

traverse_interval :: (Ord x, Ord y, Applicative f) => (Interval x -> f (Interval y)) -> Sieve x -> f (Sieve y) Source #

Like traverse but working on Intervals.

traverse_interval_unsafe :: (Ord x, Applicative f) => (Interval x -> f (Interval x)) -> Sieve x -> f (Sieve x) Source #

Like traverse but working on Intervals, and safe only if Measure is preserved.

data Measure x Source #

Measure of each leaf or node of the Sieve FingerTree.

Constructors

Measure_Empty

Measure of empty Fingertree.

Measure 

Fields

Instances

Ord x => Monoid (Measure x) Source # 

Methods

mempty :: Measure x #

mappend :: Measure x -> Measure x -> Measure x #

mconcat :: [Measure x] -> Measure x #

empty :: Ord x => Sieve x Source #

null :: Ord x => Sieve x -> Bool Source #

Return the True iif. the given Sieve is empty.

interval :: Ord x => Sieve x -> Maybe (Interval x) Source #

Return an Interval with:

intervals :: Ord x => Sieve x -> [Interval x] Source #

All the Intervals of the Sieve in ..<<.. order.

Union

union :: Ord x => Sieve x -> Sieve x -> Sieve x Source #

Return a Sieve merging the given Sieves with union.

from_Foldable :: (Foldable f, Ord x) => f (Interval x) -> Sieve x Source #

Return a Sieve merging the Intervals in the given Foldable with union.

Intersection

intersection :: Ord x => Sieve x -> Sieve x -> Sieve x Source #

Return a Sieve merging the given Sieves with intersection.

intersecting :: Ord x => Interval x -> Sieve x -> [Interval x] Source #

All Intervals having a non-Nothing intersection with the given Interval, in ..<<.. order.

Complement

complement :: (Ord x, Bounded (Limit x)) => Sieve x -> Sieve x Source #

Return the Sieve spanning over all the values not within the given Sieve.

complement_with :: Ord x => Interval x -> Sieve x -> Sieve x Source #

Return the Sieve spanning over all the values not within the given Sieve, but within the given Interval which MUST be onto every Interval inside the Sieve.

Orphan instances

Ord x => Measured (Measure x) (Interval x) Source # 

Methods

measure :: Interval x -> Measure x #