Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

Safe HaskellNone

Util.Ranges

Description

Ranges are half-open.

Synopsis

Documentation

data Ranges n Source #

Instances

Eq n => Eq (Ranges n) # 

Methods

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

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

Show n => Show (Ranges n) # 

Methods

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

show :: Ranges n -> String #

showList :: [Ranges n] -> ShowS #

Ord n => Monoid (Ranges n) # 

Methods

mempty :: Ranges n #

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

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

DeepSeq.NFData n => DeepSeq.NFData (Ranges n) # 

Methods

rnf :: Ranges n -> () #

Pretty.Pretty n => Pretty.Pretty (Ranges n) # 

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

It has a different type from the real fmap, but it wants to be an fmap.

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

Nothing means an everything range.

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 :: Ord n => n -> n -> Ranges n Source #

point :: Ord n => 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.