EdisonCore-1.3.2.1: A library of efficient, purely-functional data structures (Core Implementations)

CopyrightCopyright (c) 1999 2008 Chris Okasaki
LicenseMIT; see COPYRIGHT file for terms and conditions
Maintainerrobdockins AT fastmail DOT fm
Stabilitystable
PortabilityGHC, Hugs (MPTC and FD)
Safe HaskellNone
LanguageHaskell2010

Data.Edison.Coll.MinHeap

Contents

Description

A generic adaptor for bags to keep the minimum element separately.

Synopsis

Min heap adaptor type

data Min h a Source #

Instances

(Eq h, Eq a) => Eq (Min h a) Source # 

Methods

(==) :: Min h a -> Min h a -> Bool #

(/=) :: Min h a -> Min h a -> Bool #

(Eq h, OrdColl h a) => Ord (Min h a) Source # 

Methods

compare :: Min h a -> Min h a -> Ordering #

(<) :: Min h a -> Min h a -> Bool #

(<=) :: Min h a -> Min h a -> Bool #

(>) :: Min h a -> Min h a -> Bool #

(>=) :: Min h a -> Min h a -> Bool #

max :: Min h a -> Min h a -> Min h a #

min :: Min h a -> Min h a -> Min h a #

(OrdColl h a, Read h) => Read (Min h a) Source # 

Methods

readsPrec :: Int -> ReadS (Min h a) #

readList :: ReadS [Min h a] #

readPrec :: ReadPrec (Min h a) #

readListPrec :: ReadPrec [Min h a] #

(OrdColl h a, Show h) => Show (Min h a) Source # 

Methods

showsPrec :: Int -> Min h a -> ShowS #

show :: Min h a -> String #

showList :: [Min h a] -> ShowS #

OrdColl h a => Semigroup (Min h a) Source # 

Methods

(<>) :: Min h a -> Min h a -> Min h a #

sconcat :: NonEmpty (Min h a) -> Min h a #

stimes :: Integral b => b -> Min h a -> Min h a #

OrdColl h a => Monoid (Min h a) Source # 

Methods

mempty :: Min h a #

mappend :: Min h a -> Min h a -> Min h a #

mconcat :: [Min h a] -> Min h a #

(OrdColl h a, Arbitrary h, Arbitrary a) => Arbitrary (Min h a) Source # 

Methods

arbitrary :: Gen (Min h a) #

shrink :: Min h a -> [Min h a] #

(OrdColl h a, CoArbitrary h, CoArbitrary a) => CoArbitrary (Min h a) Source # 

Methods

coarbitrary :: Min h a -> Gen b -> Gen b #

(OrdColl h a, Ord a) => CollX (Min h a) a Source # 

Methods

singleton :: a -> Min h a #

fromSeq :: Sequence seq => seq a -> Min h a #

unionSeq :: Sequence seq => seq (Min h a) -> Min h a #

insert :: a -> Min h a -> Min h a #

insertSeq :: Sequence seq => seq a -> Min h a -> Min h a #

delete :: a -> Min h a -> Min h a #

deleteAll :: a -> Min h a -> Min h a #

deleteSeq :: Sequence seq => seq a -> Min h a -> Min h a #

null :: Min h a -> Bool #

size :: Min h a -> Int #

member :: a -> Min h a -> Bool #

count :: a -> Min h a -> Int #

strict :: Min h a -> Min h a #

structuralInvariant :: Min h a -> Bool #

instanceName :: Min h a -> String #

(OrdColl h a, Ord a) => OrdCollX (Min h a) a Source # 

Methods

deleteMin :: Min h a -> Min h a #

deleteMax :: Min h a -> Min h a #

unsafeInsertMin :: a -> Min h a -> Min h a #

unsafeInsertMax :: a -> Min h a -> Min h a #

unsafeFromOrdSeq :: Sequence seq => seq a -> Min h a #

unsafeAppend :: Min h a -> Min h a -> Min h a #

filterLT :: a -> Min h a -> Min h a #

filterLE :: a -> Min h a -> Min h a #

filterGT :: a -> Min h a -> Min h a #

filterGE :: a -> Min h a -> Min h a #

partitionLT_GE :: a -> Min h a -> (Min h a, Min h a) #

partitionLE_GT :: a -> Min h a -> (Min h a, Min h a) #

partitionLT_GT :: a -> Min h a -> (Min h a, Min h a) #

(OrdColl h a, Ord a) => Coll (Min h a) a Source # 

Methods

toSeq :: Sequence seq => Min h a -> seq a #

lookup :: a -> Min h a -> a #

lookupM :: Monad m => a -> Min h a -> m a #

lookupAll :: Sequence seq => a -> Min h a -> seq a #

lookupWithDefault :: a -> a -> Min h a -> a #

fold :: (a -> b -> b) -> b -> Min h a -> b #

fold' :: (a -> b -> b) -> b -> Min h a -> b #

fold1 :: (a -> a -> a) -> Min h a -> a #

fold1' :: (a -> a -> a) -> Min h a -> a #

filter :: (a -> Bool) -> Min h a -> Min h a #

partition :: (a -> Bool) -> Min h a -> (Min h a, Min h a) #

strictWith :: (a -> b) -> Min h a -> Min h a #

(OrdColl h a, Ord a) => OrdColl (Min h a) a Source # 

Methods

minView :: Monad m => Min h a -> m (a, Min h a) #

minElem :: Min h a -> a #

maxView :: Monad m => Min h a -> m (a, Min h a) #

maxElem :: Min h a -> a #

foldr :: (a -> b -> b) -> b -> Min h a -> b #

foldr' :: (a -> b -> b) -> b -> Min h a -> b #

foldl :: (b -> a -> b) -> b -> Min h a -> b #

foldl' :: (b -> a -> b) -> b -> Min h a -> b #

foldr1 :: (a -> a -> a) -> Min h a -> a #

foldr1' :: (a -> a -> a) -> Min h a -> a #

foldl1 :: (a -> a -> a) -> Min h a -> a #

foldl1' :: (a -> a -> a) -> Min h a -> a #

toOrdSeq :: Sequence seq => Min h a -> seq a #

unsafeMapMonotonic :: (a -> a) -> Min h a -> Min h a #

CollX operations

empty :: Min h a Source #

singleton :: (CollX h a, Ord a) => a -> Min h a Source #

fromSeq :: (OrdColl h a, Ord a, Sequence s) => s a -> Min h a Source #

insert :: (OrdCollX h a, Ord a) => a -> Min h a -> Min h a Source #

insertSeq :: (OrdColl h a, Ord a, Sequence s) => s a -> Min h a -> Min h a Source #

union :: (OrdCollX h a, Ord a) => Min h a -> Min h a -> Min h a Source #

unionSeq :: (OrdColl h a, Ord a, Sequence s) => s (Min h a) -> Min h a Source #

delete :: (OrdColl h a, Ord a) => a -> Min h a -> Min h a Source #

deleteAll :: (OrdColl h a, Ord a) => a -> Min h a -> Min h a Source #

deleteSeq :: (OrdColl h a, Ord a, Sequence s) => s a -> Min h a -> Min h a Source #

null :: Min h a -> Bool Source #

size :: CollX h a => Min h a -> Int Source #

member :: (CollX h a, Ord a) => a -> Min h a -> Bool Source #

count :: (CollX h a, Ord a) => a -> Min h a -> Int Source #

strict :: (CollX h a, Ord a) => Min h a -> Min h a Source #

Coll operations

toSeq :: (Coll h a, Sequence s) => Min h a -> s a Source #

lookup :: (Coll h a, Ord a) => a -> Min h a -> a Source #

lookupM :: (Coll h a, Ord a, Monad m) => a -> Min h a -> m a Source #

lookupAll :: (Coll h a, Ord a, Sequence s) => a -> Min h a -> s a Source #

lookupWithDefault :: (Coll h a, Ord a) => a -> a -> Min h a -> a Source #

fold :: Coll h a => (a -> b -> b) -> b -> Min h a -> b Source #

fold' :: Coll h a => (a -> b -> b) -> b -> Min h a -> b Source #

fold1 :: Coll h a => (a -> a -> a) -> Min h a -> a Source #

fold1' :: Coll h a => (a -> a -> a) -> Min h a -> a Source #

filter :: OrdColl h a => (a -> Bool) -> Min h a -> Min h a Source #

partition :: OrdColl h a => (a -> Bool) -> Min h a -> (Min h a, Min h a) Source #

strictWith :: OrdColl h a => (a -> b) -> Min h a -> Min h a Source #

OrdCollX operations

deleteMin :: (OrdColl h a, Ord a) => Min h a -> Min h a Source #

deleteMax :: (OrdCollX h a, Ord a) => Min h a -> Min h a Source #

unsafeInsertMin :: (OrdCollX h a, Ord a) => a -> Min h a -> Min h a Source #

unsafeInsertMax :: (OrdCollX h a, Ord a) => a -> Min h a -> Min h a Source #

unsafeFromOrdSeq :: (OrdCollX h a, Ord a, Sequence s) => s a -> Min h a Source #

unsafeAppend :: (OrdCollX h a, Ord a) => Min h a -> Min h a -> Min h a Source #

filterLT :: (OrdCollX h a, Ord a) => a -> Min h a -> Min h a Source #

filterLE :: (OrdCollX h a, Ord a) => a -> Min h a -> Min h a Source #

filterGT :: (OrdColl h a, Ord a) => a -> Min h a -> Min h a Source #

filterGE :: (OrdColl h a, Ord a) => a -> Min h a -> Min h a Source #

partitionLT_GE :: (OrdColl h a, Ord a) => a -> Min h a -> (Min h a, Min h a) Source #

partitionLE_GT :: (OrdColl h a, Ord a) => a -> Min h a -> (Min h a, Min h a) Source #

partitionLT_GT :: (OrdColl h a, Ord a) => a -> Min h a -> (Min h a, Min h a) Source #

OrdColl operations

minView :: (OrdColl h a, Ord a, Monad m) => Min h a -> m (a, Min h a) Source #

minElem :: (OrdColl h a, Ord a) => Min h a -> a Source #

maxView :: (OrdColl h a, Ord a, Monad m) => Min h a -> m (a, Min h a) Source #

maxElem :: (OrdColl h a, Ord a) => Min h a -> a Source #

foldr :: (OrdColl h a, Ord a) => (a -> b -> b) -> b -> Min h a -> b Source #

foldr' :: (OrdColl h a, Ord a) => (a -> b -> b) -> b -> Min h a -> b Source #

foldl :: (OrdColl h a, Ord a) => (b -> a -> b) -> b -> Min h a -> b Source #

foldl' :: (OrdColl h a, Ord a) => (b -> a -> b) -> b -> Min h a -> b Source #

foldr1 :: (OrdColl h a, Ord a) => (a -> a -> a) -> Min h a -> a Source #

foldr1' :: (OrdColl h a, Ord a) => (a -> a -> a) -> Min h a -> a Source #

foldl1 :: (OrdColl h a, Ord a) => (a -> a -> a) -> Min h a -> a Source #

foldl1' :: (OrdColl h a, Ord a) => (a -> a -> a) -> Min h a -> a Source #

toOrdSeq :: (OrdColl h a, Ord a, Sequence s) => Min h a -> s a Source #

unsafeMapMonotonic :: (OrdColl h a, Ord a) => (a -> a) -> Min h a -> Min h a Source #

Other supported operations

toColl :: OrdColl h a => Min h a -> h Source #

fromColl :: OrdColl h a => h -> Min h a Source #

Documentation