Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Util.Ranges

Description

Ranges are half-open.

Synopsis

Documentation

data Ranges n Source #

Instances

Instances details
Ord n => Monoid (Ranges n) Source # 
Instance details

Defined in Util.Ranges

Methods

mempty :: Ranges n #

mappend :: Ranges n -> Ranges n -> Ranges n #

mconcat :: [Ranges n] -> Ranges n #

Ord n => Semigroup (Ranges n) Source # 
Instance details

Defined in Util.Ranges

Methods

(<>) :: Ranges n -> Ranges n -> Ranges n #

sconcat :: NonEmpty (Ranges n) -> Ranges n #

stimes :: Integral b => b -> Ranges n -> Ranges n #

Show n => Show (Ranges n) Source # 
Instance details

Defined in Util.Ranges

Methods

showsPrec :: Int -> Ranges n -> ShowS #

show :: Ranges n -> String #

showList :: [Ranges n] -> ShowS #

DeepSeq.NFData n => DeepSeq.NFData (Ranges n) Source # 
Instance details

Defined in Util.Ranges

Methods

rnf :: Ranges n -> () #

Eq n => Eq (Ranges n) Source # 
Instance details

Defined in Util.Ranges

Methods

(==) :: Ranges n -> Ranges n -> Bool #

(/=) :: Ranges n -> Ranges n -> Bool #

Pretty.Pretty n => Pretty.Pretty (Ranges n) Source # 
Instance details

Defined in Util.Ranges

extract :: Ranges n -> Maybe [(n, n)] Source #

Nothing means an everything range.

extract1 :: Ranges n -> Maybe (Maybe (n, n)) Source #

Nothing means no ranges, Just Nothing means Everything.

pair_map :: Ord b => ((a, a) -> (b, b)) -> Ranges a -> Ranges b Source #

ranges :: Ord n => [(n, n)] -> Ranges n Source #

This doesn't ensure that, given (s, e), s <= e.

sorted_ranges :: Ord n => [(n, n)] -> Ranges n Source #

merge_sorted :: Ord n => [(n, n)] -> [(n, n)] Source #

range :: n -> n -> Ranges n Source #

point :: n -> Ranges n Source #

overlapping_closed :: Ord n => Ranges n -> Ranges n -> Bool Source #

This is like overlapping, except the ranges are closed instead of half-open.

invert :: Ord n => (n, n) -> Ranges n -> Ranges n Source #

Given a complete range, invert the ranges.