monus-weighted-search-0.2.0.0: Efficient search weighted by an ordered monoid with monus.
Safe HaskellNone
LanguageHaskell2010

Control.Comonad.Heap.Pointed

Description

 
Synopsis

Documentation

data Heap w a Source #

Constructors

Leaf 
Node !(Root w a) 

Instances

Instances details
Arbitrary2 Heap Source # 
Instance details

Defined in Control.Comonad.Heap.Pointed

Methods

liftArbitrary2 :: Gen a -> Gen b -> Gen (Heap a b) #

liftShrink2 :: (a -> [a]) -> (b -> [b]) -> Heap a b -> [Heap a b] #

Bitraversable Heap Source # 
Instance details

Defined in Control.Comonad.Heap.Pointed

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Heap a b -> f (Heap c d) #

Bifoldable Heap Source # 
Instance details

Defined in Control.Comonad.Heap.Pointed

Methods

bifold :: Monoid m => Heap m m -> m #

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Heap a b -> m #

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Heap a b -> c #

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Heap a b -> c #

Bifunctor Heap Source # 
Instance details

Defined in Control.Comonad.Heap.Pointed

Methods

bimap :: (a -> b) -> (c -> d) -> Heap a c -> Heap b d #

first :: (a -> b) -> Heap a c -> Heap b c #

second :: (b -> c) -> Heap a b -> Heap a c #

Functor (Heap w) Source # 
Instance details

Defined in Control.Comonad.Heap.Pointed

Methods

fmap :: (a -> b) -> Heap w a -> Heap w b #

(<$) :: a -> Heap w b -> Heap w a #

Foldable (Heap w) Source # 
Instance details

Defined in Control.Comonad.Heap.Pointed

Methods

fold :: Monoid m => Heap w m -> m #

foldMap :: Monoid m => (a -> m) -> Heap w a -> m #

foldMap' :: Monoid m => (a -> m) -> Heap w a -> m #

foldr :: (a -> b -> b) -> b -> Heap w a -> b #

foldr' :: (a -> b -> b) -> b -> Heap w a -> b #

foldl :: (b -> a -> b) -> b -> Heap w a -> b #

foldl' :: (b -> a -> b) -> b -> Heap w a -> b #

foldr1 :: (a -> a -> a) -> Heap w a -> a #

foldl1 :: (a -> a -> a) -> Heap w a -> a #

toList :: Heap w a -> [a] #

null :: Heap w a -> Bool #

length :: Heap w a -> Int #

elem :: Eq a => a -> Heap w a -> Bool #

maximum :: Ord a => Heap w a -> a #

minimum :: Ord a => Heap w a -> a #

sum :: Num a => Heap w a -> a #

product :: Num a => Heap w a -> a #

Traversable (Heap w) Source # 
Instance details

Defined in Control.Comonad.Heap.Pointed

Methods

traverse :: Applicative f => (a -> f b) -> Heap w a -> f (Heap w b) #

sequenceA :: Applicative f => Heap w (f a) -> f (Heap w a) #

mapM :: Monad m => (a -> m b) -> Heap w a -> m (Heap w b) #

sequence :: Monad m => Heap w (m a) -> m (Heap w a) #

Arbitrary w => Arbitrary1 (Heap w) Source # 
Instance details

Defined in Control.Comonad.Heap.Pointed

Methods

liftArbitrary :: Gen a -> Gen (Heap w a) #

liftShrink :: (a -> [a]) -> Heap w a -> [Heap w a] #

Generic1 (Heap w :: Type -> Type) Source # 
Instance details

Defined in Control.Comonad.Heap.Pointed

Associated Types

type Rep1 (Heap w) :: k -> Type #

Methods

from1 :: forall (a :: k). Heap w a -> Rep1 (Heap w) a #

to1 :: forall (a :: k). Rep1 (Heap w) a -> Heap w a #

(Eq w, Eq a) => Eq (Heap w a) Source # 
Instance details

Defined in Control.Comonad.Heap.Pointed

Methods

(==) :: Heap w a -> Heap w a -> Bool #

(/=) :: Heap w a -> Heap w a -> Bool #

(Data w, Data a) => Data (Heap w a) Source # 
Instance details

Defined in Control.Comonad.Heap.Pointed

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Heap w a -> c (Heap w a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Heap w a) #

toConstr :: Heap w a -> Constr #

dataTypeOf :: Heap w a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Heap w a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Heap w a)) #

gmapT :: (forall b. Data b => b -> b) -> Heap w a -> Heap w a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Heap w a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Heap w a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Heap w a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Heap w a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Heap w a -> m (Heap w a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Heap w a -> m (Heap w a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Heap w a -> m (Heap w a) #

(Ord w, Ord a) => Ord (Heap w a) Source # 
Instance details

Defined in Control.Comonad.Heap.Pointed

Methods

compare :: Heap w a -> Heap w a -> Ordering #

(<) :: Heap w a -> Heap w a -> Bool #

(<=) :: Heap w a -> Heap w a -> Bool #

(>) :: Heap w a -> Heap w a -> Bool #

(>=) :: Heap w a -> Heap w a -> Bool #

max :: Heap w a -> Heap w a -> Heap w a #

min :: Heap w a -> Heap w a -> Heap w a #

(Read w, Read a) => Read (Heap w a) Source # 
Instance details

Defined in Control.Comonad.Heap.Pointed

Methods

readsPrec :: Int -> ReadS (Heap w a) #

readList :: ReadS [Heap w a] #

readPrec :: ReadPrec (Heap w a) #

readListPrec :: ReadPrec [Heap w a] #

(Show w, Show a) => Show (Heap w a) Source # 
Instance details

Defined in Control.Comonad.Heap.Pointed

Methods

showsPrec :: Int -> Heap w a -> ShowS #

show :: Heap w a -> String #

showList :: [Heap w a] -> ShowS #

Generic (Heap w a) Source # 
Instance details

Defined in Control.Comonad.Heap.Pointed

Associated Types

type Rep (Heap w a) :: Type -> Type #

Methods

from :: Heap w a -> Rep (Heap w a) x #

to :: Rep (Heap w a) x -> Heap w a #

(Arbitrary w, Arbitrary a) => Arbitrary (Heap w a) Source # 
Instance details

Defined in Control.Comonad.Heap.Pointed

Methods

arbitrary :: Gen (Heap w a) #

shrink :: Heap w a -> [Heap w a] #

(NFData w, NFData a) => NFData (Heap w a) Source # 
Instance details

Defined in Control.Comonad.Heap.Pointed

Methods

rnf :: Heap w a -> () #

type Rep1 (Heap w :: Type -> Type) Source # 
Instance details

Defined in Control.Comonad.Heap.Pointed

type Rep1 (Heap w :: Type -> Type) = D1 ('MetaData "Heap" "Control.Comonad.Heap.Pointed" "monus-weighted-search-0.2.0.0-inplace" 'False) (C1 ('MetaCons "Leaf" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Node" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec1 (Heap w))))
type Rep (Heap w a) Source # 
Instance details

Defined in Control.Comonad.Heap.Pointed

type Rep (Heap w a) = D1 ('MetaData "Heap" "Control.Comonad.Heap.Pointed" "monus-weighted-search-0.2.0.0-inplace" 'False) (C1 ('MetaCons "Leaf" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Node" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 (Root w a))))

type Root = Heap Source #

pattern Root :: !w -> a -> [Heap w a] -> Heap w a Source #

popMin :: Monus w => Heap w a -> Maybe ((w, a), Heap w a) Source #

singleton :: w -> a -> Heap w a Source #

(<+>) :: Monus w => Heap w a -> Heap w a -> Heap w a Source #

dijkstra :: Ord a => Graph a -> Graph a Source #

An implementation of Dijkstra's algorithm on Graphs.

monusSort :: Ord a => [a] -> [a] Source #

Heapsort.

fromList :: Monus w => [(w, a)] -> Heap w a Source #