Copyright | Copyright (c) 1999 2008 Chris Okasaki |
---|---|
License | MIT; see COPYRIGHT file for terms and conditions |
Maintainer | robdockins AT fastmail DOT fm |
Stability | stable |
Portability | GHC, Hugs (MPTC and FD) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Data.Edison.Coll.MinHeap
Description
A generic adaptor for bags to keep the minimum element separately.
Synopsis
- data Min h a
- empty :: Min h a
- singleton :: (CollX h a, Ord a) => a -> Min h a
- fromSeq :: (OrdColl h a, Ord a, Sequence s) => s a -> Min h a
- insert :: (OrdCollX h a, Ord a) => a -> Min h a -> Min h a
- insertSeq :: (OrdColl h a, Ord a, Sequence s) => s a -> Min h a -> Min h a
- union :: (OrdCollX h a, Ord a) => Min h a -> Min h a -> Min h a
- unionSeq :: (OrdColl h a, Ord a, Sequence s) => s (Min h a) -> Min h a
- delete :: (OrdColl h a, Ord a) => a -> Min h a -> Min h a
- deleteAll :: (OrdColl h a, Ord a) => a -> Min h a -> Min h a
- deleteSeq :: (OrdColl h a, Ord a, Sequence s) => s a -> Min h a -> Min h a
- null :: Min h a -> Bool
- size :: CollX h a => Min h a -> Int
- member :: (CollX h a, Ord a) => a -> Min h a -> Bool
- count :: (CollX h a, Ord a) => a -> Min h a -> Int
- strict :: (CollX h a, Ord a) => Min h a -> Min h a
- structuralInvariant :: (Ord a, OrdColl h a) => Min h a -> Bool
- toSeq :: (Coll h a, Sequence s) => Min h a -> s a
- lookup :: (Coll h a, Ord a) => a -> Min h a -> a
- lookupM :: (Coll h a, Ord a, MonadFail m) => a -> Min h a -> m a
- lookupAll :: (Coll h a, Ord a, Sequence s) => a -> Min h a -> s a
- lookupWithDefault :: (Coll h a, Ord a) => a -> a -> Min h a -> a
- fold :: Coll h a => (a -> b -> b) -> b -> Min h a -> b
- fold' :: Coll h a => (a -> b -> b) -> b -> Min h a -> b
- fold1 :: Coll h a => (a -> a -> a) -> Min h a -> a
- fold1' :: Coll h a => (a -> a -> a) -> Min h a -> a
- filter :: OrdColl h a => (a -> Bool) -> Min h a -> Min h a
- partition :: OrdColl h a => (a -> Bool) -> Min h a -> (Min h a, Min h a)
- strictWith :: OrdColl h a => (a -> b) -> Min h a -> Min h a
- deleteMin :: (OrdColl h a, Ord a) => Min h a -> Min h a
- deleteMax :: (OrdCollX h a, Ord a) => Min h a -> Min h a
- unsafeInsertMin :: (OrdCollX h a, Ord a) => a -> Min h a -> Min h a
- unsafeInsertMax :: (OrdCollX h a, Ord a) => a -> Min h a -> Min h a
- unsafeFromOrdSeq :: (OrdCollX h a, Ord a, Sequence s) => s a -> Min h a
- unsafeAppend :: (OrdCollX h a, Ord a) => Min h a -> Min h a -> Min h a
- filterLT :: (OrdCollX h a, Ord a) => a -> Min h a -> Min h a
- filterLE :: (OrdCollX h a, Ord a) => a -> Min h a -> Min h a
- filterGT :: (OrdColl h a, Ord a) => a -> Min h a -> Min h a
- filterGE :: (OrdColl h a, Ord a) => a -> Min h a -> Min h a
- partitionLT_GE :: (OrdColl h a, Ord a) => a -> Min h a -> (Min h a, Min h a)
- partitionLE_GT :: (OrdColl h a, Ord a) => a -> Min h a -> (Min h a, Min h a)
- partitionLT_GT :: (OrdColl h a, Ord a) => a -> Min h a -> (Min h a, Min h a)
- minView :: (OrdColl h a, Ord a, MonadFail m) => Min h a -> m (a, Min h a)
- minElem :: (OrdColl h a, Ord a) => Min h a -> a
- maxView :: (OrdColl h a, Ord a, MonadFail m) => Min h a -> m (a, Min h a)
- maxElem :: (OrdColl h a, Ord a) => Min h a -> a
- foldr :: (OrdColl h a, Ord a) => (a -> b -> b) -> b -> Min h a -> b
- foldr' :: (OrdColl h a, Ord a) => (a -> b -> b) -> b -> Min h a -> b
- foldl :: (OrdColl h a, Ord a) => (b -> a -> b) -> b -> Min h a -> b
- foldl' :: (OrdColl h a, Ord a) => (b -> a -> b) -> b -> Min h a -> b
- foldr1 :: (OrdColl h a, Ord a) => (a -> a -> a) -> Min h a -> a
- foldr1' :: (OrdColl h a, Ord a) => (a -> a -> a) -> Min h a -> a
- foldl1 :: (OrdColl h a, Ord a) => (a -> a -> a) -> Min h a -> a
- foldl1' :: (OrdColl h a, Ord a) => (a -> a -> a) -> Min h a -> a
- toOrdSeq :: (OrdColl h a, Ord a, Sequence s) => Min h a -> s a
- unsafeMapMonotonic :: (OrdColl h a, Ord a) => (a -> a) -> Min h a -> Min h a
- toColl :: OrdColl h a => Min h a -> h
- fromColl :: OrdColl h a => h -> Min h a
- moduleName :: String
Min heap adaptor type
Instances
(OrdColl h a, Arbitrary h, Arbitrary a) => Arbitrary (Min h a) Source # | |
(OrdColl h a, CoArbitrary h, CoArbitrary a) => CoArbitrary (Min h a) Source # | |
Defined in Data.Edison.Coll.MinHeap Methods coarbitrary :: Min h a -> Gen b -> Gen b # | |
OrdColl h a => Monoid (Min h a) Source # | |
OrdColl h a => Semigroup (Min h a) Source # | |
(OrdColl h a, Read h) => Read (Min h a) Source # | |
(OrdColl h a, Show h) => Show (Min h a) Source # | |
(Eq a, Eq h) => Eq (Min h a) Source # | |
(Eq h, OrdColl h a) => Ord (Min h a) Source # | |
Defined in Data.Edison.Coll.MinHeap | |
(OrdColl h a, Ord a) => Coll (Min h a) a Source # | |
Defined in Data.Edison.Coll.MinHeap Methods toSeq :: Sequence seq => Min h a -> seq a # lookupM :: MonadFail 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) => CollX (Min h a) a Source # | |
Defined in Data.Edison.Coll.MinHeap Methods 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 # 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) => OrdColl (Min h a) a Source # | |
Defined in Data.Edison.Coll.MinHeap Methods minView :: MonadFail m => Min h a -> m (a, Min h a) # maxView :: MonadFail m => Min h a -> m (a, Min h 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 # | |
(OrdColl h a, Ord a) => OrdCollX (Min h a) a Source # | |
Defined in Data.Edison.Coll.MinHeap 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) # |
CollX operations
Coll operations
OrdCollX operations
OrdColl operations
Other supported operations
Documentation
moduleName :: String Source #