interval-patterns-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

Data.Interval.Layers

Synopsis

Documentation

data Layers x y Source #

Instances

Instances details
Functor (Layers x) Source # 
Instance details

Defined in Data.Interval.Layers

Methods

fmap :: (a -> b) -> Layers x a -> Layers x b #

(<$) :: a -> Layers x b -> Layers x a #

(Ord x, Eq y) => Eq (Layers x y) Source # 
Instance details

Defined in Data.Interval.Layers

Methods

(==) :: Layers x y -> Layers x y -> Bool #

(/=) :: Layers x y -> Layers x y -> Bool #

(Ord x, Ord y) => Ord (Layers x y) Source # 
Instance details

Defined in Data.Interval.Layers

Methods

compare :: Layers x y -> Layers x y -> Ordering #

(<) :: Layers x y -> Layers x y -> Bool #

(<=) :: Layers x y -> Layers x y -> Bool #

(>) :: Layers x y -> Layers x y -> Bool #

(>=) :: Layers x y -> Layers x y -> Bool #

max :: Layers x y -> Layers x y -> Layers x y #

min :: Layers x y -> Layers x y -> Layers x y #

(Ord x, Show x, Show y) => Show (Layers x y) Source # 
Instance details

Defined in Data.Interval.Layers

Methods

showsPrec :: Int -> Layers x y -> ShowS #

show :: Layers x y -> String #

showList :: [Layers x y] -> ShowS #

Generic (Layers x y) Source # 
Instance details

Defined in Data.Interval.Layers

Associated Types

type Rep (Layers x y) :: Type -> Type #

Methods

from :: Layers x y -> Rep (Layers x y) x0 #

to :: Rep (Layers x y) x0 -> Layers x y #

(Ord x, Semigroup y) => Semigroup (Layers x y) Source # 
Instance details

Defined in Data.Interval.Layers

Methods

(<>) :: Layers x y -> Layers x y -> Layers x y #

sconcat :: NonEmpty (Layers x y) -> Layers x y #

stimes :: Integral b => b -> Layers x y -> Layers x y #

(Ord x, Semigroup y) => Monoid (Layers x y) Source # 
Instance details

Defined in Data.Interval.Layers

Methods

mempty :: Layers x y #

mappend :: Layers x y -> Layers x y -> Layers x y #

mconcat :: [Layers x y] -> Layers x y #

(Ord x, Group y) => Group (Layers x y) Source # 
Instance details

Defined in Data.Interval.Layers

Methods

invert :: Layers x y -> Layers x y #

(~~) :: Layers x y -> Layers x y -> Layers x y #

pow :: Integral x0 => Layers x y -> x0 -> Layers x y #

type Rep (Layers x y) Source # 
Instance details

Defined in Data.Interval.Layers

type Rep (Layers x y) = D1 ('MetaData "Layers" "Data.Interval.Layers" "interval-patterns-0.1.0.0-4KN9HNYiN2a950fkOd0JXU" 'True) (C1 ('MetaCons "Layers" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map (Interval x) y))))

fromList :: (Ord x, Semigroup y) => [(Interval x, y)] -> Layers x y Source #

Draw the Layers of specified bases and thicknesses.

toList :: Ord x => Layers x y -> [(Interval x, y)] Source #

Get all of the bases and thicknesses in the Layers.

empty :: Layers x y Source #

A blank canvas.

singleton :: Ord x => Interval x -> y -> Layers x y Source #

singleton ix y is the rectangle with base ix of thickness y.

insert :: (Ord x, Semigroup y) => Interval x -> y -> Layers x y -> Layers x y Source #

insert ix y l draws over l a rectangle with base ix of thickness y.

squash :: Ord x => Layers x y -> Borel x Source #

Ignore the Layers and focus only on whether points are within any contained Interval or not.

thickness :: (Ord x, Monoid y) => x -> Layers x y -> y Source #

Get the thickness of the Layers at a point.

thickest :: (Ord x, Ord y) => Layers x y -> Maybe (Interval x, y) Source #

Where and how thick is the thickest Interval?

remove :: (Ord x, Group y) => y -> Interval x -> Layers x y -> Layers x y Source #

Take away a thickness over a given base from the Layers.

baseline :: (Ord x, Semigroup y) => y -> Layers x y -> Layers x y Source #

Add the given thickness to every point.

Helper functions

nestings :: (Ord x, Semigroup y) => [(Interval x, y)] -> [(Interval x, y)] Source #

nestingsAsc :: (Ord x, Semigroup y) => [(Interval x, y)] -> [(Interval x, y)] Source #